Sign inSign up

keitaro/ckan

By keitaro

•Updated 28 days ago

CKAN Docker Images

Image
2

100K+

keitaro/ckan repository overview

⁠CKAN Docker images

CKAN – The Open Source platform for Open Data! Dockerfile location⁠

Looking to run CKAN on Kubernetes? Check out our CKAN Helm Chart⁠!

Run CKAN using docker compose⁠.

⁠Overview

All images are based on Alpine Linux⁠ and include only required extensions to start a CKAN instance. The docker images are built using a multi-stage docker approach in order to produce slim production grade docker images with the right libraries and configuration. This multi-stage approach allows us to build python binary wheels in the build stages that later on we install in the main stage.

⁠Extending CKAN docker images

Check some examples of extending CKAN docker images in the examples⁠ directory.

We recommend to use a multi-stage approach to extend the docker images that we provide here. To extend the images the following Dockerfile structure is recommended:

###################
### Extensions ####
###################
FROM keitaro/ckan:2.9.1 as extbuild

# Switch to the root user
USER root

# Install any system packages necessary to build extensions
RUN apk add --no-cache python3-dev

# Fetch and build the custom CKAN extensions
RUN pip wheel --wheel-dir=/wheels git+https://github.com/acmecorp/[email protected]#egg=ckanext-acme

############
### MAIN ###
############
FROM keitaro/ckan:2.9.1

# Add the custom extensions to the plugins list
ENV CKAN__PLUGINS envvars image_view text_view recline_view datastore datapusher acme

# Switch to the root user
USER root

COPY --from=extbuild /wheels /srv/app/ext_wheels

# Install and enable the custom extensions
RUN pip install --no-index --find-links=/srv/app/ext_wheels ckanext-acme && \
    ckan -c ${APP_DIR}/production.ini config-tool "ckan.plugins = ${CKAN__PLUGINS}" && \
    chown -R ckan:ckan /srv/app

# Remove wheels
RUN rm -rf /srv/app/ext_wheels

# Switch to the ckan user
USER ckan
⁠Adding init and afterinit scripts

You can add scripts to CKAN custom images and copy them to the docker-entrypoint.d directory. Any *.sh or *.py file in that directory will be executed before the main initialization script (prerun.py) is executed.

You can add scripts to CKAN custom images and copy them to the docker-afterinit.d directory. Any *.sh or *.py file in that directory will be executed after the main initialization script (prerun.py) is executed.

Tag summary

Content type

Image

Digest

sha256:b7f5a23bb…

Size

175 MB

Last updated

over 1 year ago

docker pull keitaro/ckan