Skip to content

Commit

Permalink
Merge branch 'main' into automate-build-push
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Nov 11, 2024
2 parents 89cdbfd + b0a27df commit 3f176c2
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 170 deletions.
Binary file removed ContainerCanary/canary_darwin_amd64
Binary file not shown.
1 change: 0 additions & 1 deletion ContainerCanary/canary_darwin_amd64.sha256sum

This file was deleted.

34 changes: 0 additions & 34 deletions ContainerCanary/ckan.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions README.ContainerCanary.txt

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ The following CKAN versions are available in base or dev forms. They are disting
| 2.9.x | dev image | `alpine:3.15` | `ckan/ckan-dev:2.9.11`, `ckan/ckan-dev:2.9` | |
| 2.9.x | base image | `python:3.9-slim-bookworm` | `ckan/ckan-base:2.9-py3.9`, `ckan/ckan-base:2.9.11-py3.9` | |
| 2.9.x | dev image | `python:3.9-slim-bookworm` | `ckan/ckan-dev:2.9-py3.9`, `ckan/ckan-dev:2.9.11-py3.9` | |
| 2.10.x | base image | `alpine:3.17` | `ckan/ckan-base:2.10.4`, `ckan/ckan-base:2.10` | |
| 2.10.x | dev image | `alpine:3.17` | `ckan/ckan-dev:2.10.4`, `ckan/ckan-dev:2.10` | |
| 2.10.x | base image | `python:3.10-slim-bookworm` | `ckan/ckan-base:2.10-py3.10`, `ckan/ckan-base:2.10.4-py3.10` | |
| 2.10.x | dev image | `python:3.10-slim-bookworm` | `ckan/ckan-dev:2.10-py3.10`, `ckan/ckan-dev:2.10.4-py3.10` | |
| 2.11.x | base image | `python:3.10-slim-bookworm` | `ckan/ckan-base:2.11`, `ckan/ckan-base:2.11-py3.10` | |
| 2.11.x | dev image | `python:3.10-slim-bookworm` | `ckan/ckan-dev:2.11`, `ckan/ckan-dev:2.11-py3.10` | |
| 2.10.x | base image | `alpine:3.17` | `ckan/ckan-base:2.10.5`, `ckan/ckan-base:2.10` | |
| 2.10.x | dev image | `alpine:3.17` | `ckan/ckan-dev:2.10.5`, `ckan/ckan-dev:2.10` | |
| 2.10.x | base image | `python:3.10-slim-bookworm` | `ckan/ckan-base:2.10-py3.10`, `ckan/ckan-base:2.10.5-py3.10` | |
| 2.10.x | dev image | `python:3.10-slim-bookworm` | `ckan/ckan-dev:2.10-py3.10`, `ckan/ckan-dev:2.10.5-py3.10` | |
| 2.11.x | base image | `python:3.10-slim-bookworm` | `ckan/ckan-base:2.11`, `ckan/ckan-base:2.11.0`, `ckan/ckan-base:2.11-py3.10`, `ckan/ckan-base:2.11.0-py3.10` | |
| 2.11.x | dev image | `python:3.10-slim-bookworm` | `ckan/ckan-dev:2.11`, `ckan/ckan-dev:2.11.0`, `ckan/ckan-dev:2.11-py3.10`, `ckan/ckan-dev:2.11.0-py3.10` | |
| master | base image | `python:3.10-slim-bookworm` | `ckan/ckan-base:master`, `ckan/ckan-base:master-py3.10` | Built daily, do not use in production |
| master | dev image | `python:3.10-slim-bookworm` | `ckan/ckan-dev:master`, `ckan/ckan-dev:master-py3.10` | Built daily, do not use in production |

Expand Down
7 changes: 2 additions & 5 deletions ckan-2.10/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:3.17
ARG CKAN_VERSION=ckan-2.10.4
ARG CKAN_VERSION=ckan-2.10.5

# Internals, you probably don't need to change these
ENV TZ=UTC
Expand Down Expand Up @@ -40,8 +40,6 @@ RUN apk add --no-cache git \
uwsgi-http \
uwsgi-corerouter \
uwsgi-python \
py3-gevent \
uwsgi-gevent \
libmagic \
curl \
patch \
Expand Down Expand Up @@ -76,10 +74,9 @@ COPY setup/supervisord.conf /etc
# Install CKAN
RUN pip3 install -e git+${GIT_URL}@${GIT_BRANCH}#egg=ckan && \
cd ${SRC_DIR}/ckan && \
cp who.ini ${APP_DIR} && \
pip3 install --no-binary markdown -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 && \
pip3 install -e git+https://github.com/okfn/ckanext-envvars.git@v0.0.6#egg=ckanext-envvars && \
# Create and update CKAN config
ckan generate config ${CKAN_INI} && \
ckan config-tool ${CKAN_INI} "beaker.session.secret = " && \
Expand Down
2 changes: 1 addition & 1 deletion ckan-2.10/base/Dockerfile.py3.10
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RUN pip3 install -U pip && \
cp who.ini ${APP_DIR} && \
pip3 install --no-binary markdown -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 && \
pip3 install -e git+https://github.com/okfn/ckanext-envvars.git@v0.0.6#egg=ckanext-envvars && \
# Create and update CKAN config
ckan generate config ${CKAN_INI} && \
ckan config-tool ${CKAN_INI} "beaker.session.secret = " && \
Expand Down
4 changes: 2 additions & 2 deletions ckan-2.10/base/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all help build build-all push
SHELL := /bin/bash
CKAN_VERSION=2.10.4
CKAN_VERSION=2.10.5
PYTHON_VERSION=3.10
PYTHON.DOCKERFILE=Dockerfile.py$(PYTHON_VERSION)
CKAN_VERSION_MAJOR=$(shell echo $(CKAN_VERSION) | cut -d'.' -f1)
Expand All @@ -17,7 +17,7 @@ help:
build: ## Build CKAN 2.x.x images , `make build`
echo "Building $(TAG_NAME) and $(ALT_TAG_NAME) and $(PYTHON_TAG_NAME) images"
docker build --build-arg="CKAN_VERSION=ckan-$(CKAN_VERSION)" -t $(TAG_NAME) -t $(ALT_TAG_NAME) .
docker build --build-arg="CKAN_VERSION=ckan-$(CKAN_VERSION)" -t $(PYTHON_TAG_NAME) -t $(PYTHON_ALT_TAG_NAME) -f $(PYTHON.DOCKERFILE) .
# docker build --build-arg="CKAN_VERSION=ckan-$(CKAN_VERSION)" -t $(PYTHON_TAG_NAME) -t $(PYTHON_ALT_TAG_NAME) -f $(PYTHON.DOCKERFILE) .

push: ## Push CKAN 2.x.x images to the DockerHub registry, `make push`
echo "Pushing $(TAG_NAME) image"
Expand Down
2 changes: 1 addition & 1 deletion ckan-2.10/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ckan/ckan-base:2.10.4
FROM ckan/ckan-base:2.10.5


ENV APP_DIR=/srv/app
Expand Down
2 changes: 1 addition & 1 deletion ckan-2.10/dev/Dockerfile.py3.10
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ckan/ckan-base:2.10.4-py3.10
FROM ckan/ckan-base:2.10.5-py3.10

# Tag passed through via the Makefile
ARG CKAN_VERSION=${CKAN_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion ckan-2.10/dev/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all help build build-all push
SHELL := /bin/bash
CKAN_VERSION=2.10.4
CKAN_VERSION=2.10.5
PYTHON_VERSION=3.10
PYTHON.DOCKERFILE=Dockerfile.py$(PYTHON_VERSION)
CKAN_VERSION_MAJOR=$(shell echo $(CKAN_VERSION) | cut -d'.' -f1)
Expand Down
12 changes: 1 addition & 11 deletions ckan-2.11/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,15 @@ RUN apt-get install --no-install-recommends -y \
# Create the src directory
RUN mkdir -p ${SRC_DIR}

# Install supervisord and create the supervisord.d directory
RUN apt-get install --no-install-recommends -y \
supervisor && \
mkdir /etc/supervisord.d

COPY setup/supervisord.conf /etc

# Install uwsgi, the CKAN application, the dependency packages for CKAN plus some confiquration
RUN pip3 install -U pip && \
pip3 install uwsgi && \
cd ${SRC_DIR} && \
pip3 install -e git+${GIT_URL}@${CKAN_VERSION}#egg=ckan && \
cd ckan && \
cp who.ini ${APP_DIR} && \
pip3 install --no-binary markdown -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 && \
pip3 install -e git+https://github.com/okfn/ckanext-envvars.git@v0.0.6#egg=ckanext-envvars && \
# Create and update CKAN config
ckan generate config ${CKAN_INI} && \
ckan config-tool ${CKAN_INI} "SECRET_KEY = " && \
Expand All @@ -85,6 +77,4 @@ ONBUILD RUN mkdir /docker-entrypoint.d

EXPOSE 5000

HEALTHCHECK --interval=60s --timeout=5s --retries=5 CMD curl --fail http://localhost:5000/api/3/action/status_show || exit CMD ["/srv/app/start_ckan.sh"]

CMD ["/srv/app/start_ckan.sh"]
21 changes: 14 additions & 7 deletions ckan-2.11/base/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
.PHONY: all help build build-all push
SHELL := /bin/bash
# TODO: switch to tag upon release
CKAN_VERSION=dev-v2.11
CKAN_VERSION=2.11.0
PYTHON_VERSION=3.10
# TODO: major minor version
TAG_NAME="ckan/ckan-base:2.11"
PYTHON_TAG_NAME="ckan/ckan-base:2.11-py$(PYTHON_VERSION)"
CKAN_VERSION_MAJOR=$(shell echo $(CKAN_VERSION) | cut -d'.' -f1)
CKAN_VERSION_MINOR=$(shell echo $(CKAN_VERSION) | cut -d'.' -f2)
TAG_NAME="ckan/ckan-base:$(CKAN_VERSION)"
ALT_TAG_NAME="ckan/ckan-base:$(CKAN_VERSION_MAJOR).$(CKAN_VERSION_MINOR)"
PYTHON_TAG_NAME="ckan/ckan-base:$(CKAN_VERSION)-py$(PYTHON_VERSION)"
PYTHON_ALT_TAG_NAME="ckan/ckan-base:$(CKAN_VERSION_MAJOR).$(CKAN_VERSION_MINOR)-py$(PYTHON_VERSION)"

all: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

build: ## Build a CKAN 2.11 image , `make build`
echo "Building $(TAG_NAME) images"
docker build --build-arg="CKAN_VERSION=$(CKAN_VERSION)" -t $(TAG_NAME) -t $(PYTHON_TAG_NAME) .
echo "Building $(TAG_NAME) and $(ALT_TAG_NAME) and $(PYTHON_TAG_NAME) images"
docker build --build-arg="CKAN_VERSION=ckan-$(CKAN_VERSION)" -t $(TAG_NAME) -t $(ALT_TAG_NAME) -t $(PYTHON_TAG_NAME) -t $(PYTHON_ALT_TAG_NAME) .

push: ## Push a CKAN 2.11 image to the DockerHub registry, `make push`
echo "Pushing $(TAG_NAME) image"
docker push $(TAG_NAME)
echo "Pushing $(ALT_TAG_NAME) image"
docker push $(ALT_TAG_NAME)
echo "Pushing $(PYTHON_TAG_NAME) image"
docker push $(PYTHON_TAG_NAME)
echo "Pushing $(PYTHON_ALT_TAG_NAME) image"
docker push $(PYTHON_ALT_TAG_NAME)
2 changes: 0 additions & 2 deletions ckan-2.11/base/setup/start_ckan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ UWSGI_OPTS="--plugins http,python \

if [ $? -eq 0 ]
then
# Start supervisord
supervisord --configuration /etc/supervisord.conf &
# Start uwsgi
uwsgi $UWSGI_OPTS
else
Expand Down
23 changes: 0 additions & 23 deletions ckan-2.11/base/setup/supervisord.conf

This file was deleted.

2 changes: 0 additions & 2 deletions ckan-2.11/base/setup/uwsgi.conf

This file was deleted.

2 changes: 1 addition & 1 deletion ckan-2.11/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ckan/ckan-base:master
FROM ckan/ckan-base:2.11.0

# Tag passed through via the Makefile
ARG CKAN_VERSION=${CKAN_VERSION}
Expand Down
19 changes: 13 additions & 6 deletions ckan-2.11/dev/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
.PHONY: all help build build-all push
SHELL := /bin/bash
# TODO: switch to tag upon release
CKAN_VERSION=dev-v2.11
CKAN_VERSION=2.11.0
PYTHON_VERSION=3.10
# TODO: major minor version
TAG_NAME="ckan/ckan-dev:2.11"
PYTHON_TAG_NAME="ckan/ckan-dev:2.11-py$(PYTHON_VERSION)"
CKAN_VERSION_MAJOR=$(shell echo $(CKAN_VERSION) | cut -d'.' -f1)
CKAN_VERSION_MINOR=$(shell echo $(CKAN_VERSION) | cut -d'.' -f2)
TAG_NAME="ckan/ckan-dev:$(CKAN_VERSION)"
ALT_TAG_NAME="ckan/ckan-dev:$(CKAN_VERSION_MAJOR).$(CKAN_VERSION_MINOR)"
PYTHON_TAG_NAME="ckan/ckan-dev:$(CKAN_VERSION)-py$(PYTHON_VERSION)"
PYTHON_ALT_TAG_NAME="ckan/ckan-dev:$(CKAN_VERSION_MAJOR).$(CKAN_VERSION_MINOR)-py$(PYTHON_VERSION)"

all: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

build: ## Build a CKAN 2.11 dev image , `make build`
echo "Building $(TAG_NAME) images"
docker build --build-arg="CKAN_VERSION=$(CKAN_VERSION)" -t $(TAG_NAME) -t $(PYTHON_TAG_NAME) .
docker build --build-arg="CKAN_VERSION=ckan-$(CKAN_VERSION)" -t $(TAG_NAME) -t $(ALT_TAG_NAME) -t $(PYTHON_TAG_NAME) -t $(PYTHON_ALT_TAG_NAME) .

push: ## Push a CKAN 2.11 dev image to the DockerHub registry, `make push`
echo "Pushing $(TAG_NAME) image"
docker push $(TAG_NAME)
echo "Pushing $(ALT_TAG_NAME) image"
docker push $(ALT_TAG_NAME)
echo "Pushing $(PYTHON_TAG_NAME) image"
docker push $(PYTHON_TAG_NAME)
echo "Pushing $(PYTHON_ALT_TAG_NAME) image"
docker push $(PYTHON_ALT_TAG_NAME)
2 changes: 1 addition & 1 deletion ckan-2.9/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV GIT_URL=https://github.com/ckan/ckan.git
ENV GIT_BRANCH=${CKAN_VERSION}
# 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 envvars
ENV CKAN__PLUGINS="image_view text_view recline_view datastore envvars"

# UWSGI options
ENV UWSGI_HARAKIRI=50
Expand Down
12 changes: 1 addition & 11 deletions ckan-master/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,15 @@ RUN apt-get install --no-install-recommends -y \
# Create the src directory
RUN mkdir -p ${SRC_DIR}

# Install supervisord and create the supervisord.d directory
RUN apt-get install --no-install-recommends -y \
supervisor && \
mkdir /etc/supervisord.d

COPY setup/supervisord.conf /etc

# Install uwsgi, the CKAN application, the dependency packages for CKAN plus some confiquration
RUN pip3 install -U pip && \
pip3 install uwsgi && \
cd ${SRC_DIR} && \
pip3 install -e git+${GIT_URL}@${CKAN_VERSION}#egg=ckan && \
cd ckan && \
cp who.ini ${APP_DIR} && \
pip3 install --no-binary markdown -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 && \
pip3 install -e git+https://github.com/okfn/ckanext-envvars.git@v0.0.6#egg=ckanext-envvars && \
# Create and update CKAN config
ckan generate config ${CKAN_INI} && \
ckan config-tool ${CKAN_INI} "SECRET_KEY = " && \
Expand All @@ -85,6 +77,4 @@ ONBUILD RUN mkdir /docker-entrypoint.d

EXPOSE 5000

HEALTHCHECK --interval=60s --timeout=5s --retries=5 CMD curl --fail http://localhost:5000/api/3/action/status_show || exit CMD ["/srv/app/start_ckan.sh"]

CMD ["/srv/app/start_ckan.sh"]
2 changes: 0 additions & 2 deletions ckan-master/base/setup/start_ckan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ UWSGI_OPTS="--plugins http,python \

if [ $? -eq 0 ]
then
# Start supervisord
supervisord --configuration /etc/supervisord.conf &
# Start uwsgi
uwsgi $UWSGI_OPTS
else
Expand Down
23 changes: 0 additions & 23 deletions ckan-master/base/setup/supervisord.conf

This file was deleted.

2 changes: 0 additions & 2 deletions ckan-master/base/setup/uwsgi.conf

This file was deleted.

0 comments on commit 3f176c2

Please sign in to comment.