From 6d2c7ca328b2ea308444860501d8d7ff1033ebb4 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 5 Jan 2022 11:04:38 +0100 Subject: [PATCH] More image build changes --- README.txt | 1 - images/README | 13 +++++++++++-- images/ckan-base/2.7/Dockerfile | 8 ++++---- images/ckan-base/2.8/Dockerfile | 8 ++++---- images/ckan-base/2.9/Dockerfile | 18 ++++++++++-------- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/README.txt b/README.txt index 33f2cc2..0a61e51 100644 --- a/README.txt +++ b/README.txt @@ -20,4 +20,3 @@ Use a bind mount for the config file (ckan.ini) Maybe include a script to replace docker-compose if required - diff --git a/images/README b/images/README index 44e18b4..ac994c2 100755 --- a/images/README +++ b/images/README @@ -1,4 +1,13 @@ Build the images from this directory using: + cd ckan-base/ + docker build -t ckan/ckan-base:testing-only.2.9 -f 2.9/Dockerfile . + docker build -t ckan/ckan-base:testing-only.2.8 -f 2.8/Dockerfile . + docker build -t ckan/ckan-base:testing-only.2.7 -f 2.7/Dockerfile . - docker build -t openknowledge/ckan-dev:2.7 -f 2.7/Dockerfile . - docker build -t openknowledge/ckan-dev:2.8 -f 2.8/Dockerfile . +Login to Dockerhub +docker login --username=kowhai +(will then ask for a password) + +Push image to (ckan) Dockerhub +docker push ckan/ckan-base:testing-only.2.9 + diff --git a/images/ckan-base/2.7/Dockerfile b/images/ckan-base/2.7/Dockerfile index f3b7099..13e079a 100755 --- a/images/ckan-base/2.7/Dockerfile +++ b/images/ckan-base/2.7/Dockerfile @@ -8,7 +8,7 @@ ENV PIP_SRC=${SRC_DIR} ENV CKAN_STORAGE_PATH=/var/lib/ckan ENV GIT_URL=https://github.com/ckan/ckan.git # CKAN version to build -ENV GIT_BRANCH=ckan-2.7.8 +ENV GIT_BRANCH=ckan-2.7.12 # Customize these on the .env file if needed ENV CKAN_SITE_URL=http://localhost:5000 ENV CKAN__PLUGINS image_view text_view recline_view datastore datapusher envvars @@ -46,11 +46,11 @@ RUN apk add --no-cache tzdata \ python-dev \ libxml2-dev \ libxslt-dev \ - linux-headers && \ + linux-headers # Create SRC_DIR - mkdir -p ${SRC_DIR} && \ + RUN mkdir -p ${SRC_DIR} && \ # Install pip, supervisord and uwsgi - curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/2.7/get-pip.py && \ + curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ python ${SRC_DIR}/get-pip.py 'pip==20.3.3' && \ pip install supervisor && \ mkdir /etc/supervisord.d && \ diff --git a/images/ckan-base/2.8/Dockerfile b/images/ckan-base/2.8/Dockerfile index 48847e7..e045408 100755 --- a/images/ckan-base/2.8/Dockerfile +++ b/images/ckan-base/2.8/Dockerfile @@ -8,7 +8,7 @@ ENV PIP_SRC=${SRC_DIR} ENV CKAN_STORAGE_PATH=/var/lib/ckan ENV GIT_URL=https://github.com/ckan/ckan.git # CKAN version to build -ENV GIT_BRANCH=ckan-2.8.5 +ENV GIT_BRANCH=ckan-2.8.9 # Customize these on the .env file if needed ENV CKAN_SITE_URL=http://localhost:5000 ENV CKAN__PLUGINS image_view text_view recline_view datastore datapusher envvars @@ -46,11 +46,11 @@ RUN apk add --no-cache tzdata \ python-dev \ libxml2-dev \ libxslt-dev \ - linux-headers && \ + linux-headers # Create SRC_DIR - mkdir -p ${SRC_DIR} && \ + RUN mkdir -p ${SRC_DIR} && \ # Install pip, supervisord and uwsgi - curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/2.7/get-pip.py && \ + curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ python ${SRC_DIR}/get-pip.py 'pip==20.3.3' && \ pip install supervisor && \ mkdir /etc/supervisord.d && \ diff --git a/images/ckan-base/2.9/Dockerfile b/images/ckan-base/2.9/Dockerfile index d2665cd..4cda64c 100755 --- a/images/ckan-base/2.9/Dockerfile +++ b/images/ckan-base/2.9/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.7 +FROM alpine:3.13 # Internal environment variables ENV APP_DIR=/srv/app @@ -8,7 +8,7 @@ ENV PIP_SRC=${SRC_DIR} ENV CKAN_STORAGE_PATH=/var/lib/ckan ENV GIT_URL=https://github.com/ckan/ckan.git # CKAN version to build -ENV GIT_BRANCH=ckan-2.9.0 +ENV GIT_BRANCH=ckan-2.9.4 # Customize these on the .env file if needed ENV CKAN_SITE_URL=http://localhost:5000 ENV CKAN__PLUGINS image_view text_view recline_view datastore datapusher envvars @@ -46,12 +46,13 @@ RUN apk add --no-cache tzdata \ py3-virtualenv \ libxml2-dev \ libxslt-dev \ - linux-headers && \ - # Create SRC_DIR - mkdir -p ${SRC_DIR} && \ + linux-headers + +# Create SRC_DIR and install pip +RUN mkdir -p ${SRC_DIR} && \ # Install pip - curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/2.7/get-pip.py && \ - python3 ${SRC_DIR}/get-pip.py 'pip==20.3.3' && \ + curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/get-pip.py && \ + python3 ${SRC_DIR}/get-pip.py && \ rm -rf ${SRC_DIR}/get-pip.py # Set up Python3 virtual environment @@ -67,7 +68,8 @@ RUN pip3 install -e git+${GIT_URL}@${GIT_BRANCH}#egg=ckan && \ pip3 install uwsgi && \ cd ${SRC_DIR}/ckan && \ cp who.ini ${APP_DIR} && \ - pip install --no-binary :all: -r requirements.txt && \ + pip3 install -r requirement-setuptools.txt && \ + pip3 install --no-binary :all: -r requirements.txt && \ # Install CKAN envvars to support loading config from environment variables pip3 install -e git+https://github.com/okfn/ckanext-envvars.git#egg=ckanext-envvars && \ # Create and update CKAN config