[ckan-changes] [ckan/ckan] 63a849: Add Dockerfile for building a CKAN 2.2 image

GitHub noreply at github.com
Mon Jun 30 12:19:31 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/ckan/ckan
  Commit: 63a8492f57025f6c6d64e000fd4a6a26a56a3aa8
      https://github.com/ckan/ckan/commit/63a8492f57025f6c6d64e000fd4a6a26a56a3aa8
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-10 (Tue, 10 Jun 2014)

  Changed paths:
    A Dockerfile
    A contrib/docker/nginx.conf
    A contrib/docker/svc/ckan/run
    A contrib/docker/svc/nginx/run

  Log Message:
  -----------
  Add Dockerfile for building a CKAN 2.2 image

This commit adds a Dockerfile and support files (including nginx and
runit configuration) for a binary CKAN 2.2 docker image.

Specifically, this allows you to build a docker image including CKAN
2.2, running behind nginx and gunicorn, by running

    docker build .

For example, to build an image called ckan/ckan tagged at version 2.2,
you might run

    docker build -t ckan/ckan:2.2 .

The resulting image contains only CKAN, with a nearly vanilla
configuration. In order to use it, you must do one of two things. You
can either use the vanilla configuration as-is, and this requires that
you specify the location of a Postgres database and a Solr core on
startup:

    docker run -i -t -p 80:80 \
      -e DATABASE_URL=postgres://user:pass@hostname/db \
      -e SOLR_URL=http://hostname:8983/solr/ckan_default \
      ckan/ckan:2.2

This will run CKAN, connect to the database, and initialise it if need
be. Configuring Solr will have to be done separately.

Alternatively, you can use this image as a base for extension. If a
configuration file is injected to /etc/ckan/default.ini, the image will
use that and ignore the DATABASE_URL and SOLR_URL environment variables.

Lastly, by default the CKAN file store is at /var/lib/ckan, and you may
well wish to mount this data volume outside the running container:

    docker run ... -v /mnt/storage:/var/lib/ckan ...


  Commit: 51ffc2e75ee42bab676509d0bc462f6adb0dc509
      https://github.com/ckan/ckan/commit/51ffc2e75ee42bab676509d0bc462f6adb0dc509
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-10 (Tue, 10 Jun 2014)

  Changed paths:
    M Dockerfile
    A contrib/docker/main.cf
    M contrib/docker/svc/ckan/run
    A contrib/docker/svc/postfix/run

  Log Message:
  -----------
  Add postfix to docker image and allow configuration

This ensures that we can configure error emails from the CKAN instance
inside the container.

An optional environment variable, ERROR_EMAIL, can be set for the
container. If set, it will configure CKAN to send error emails to
$ERROR_EMAIL. If unset, no emails will be sent.


  Commit: 13b4d3636c7f13bc0936dc6bc1d2a69515f7d4d6
      https://github.com/ckan/ckan/commit/13b4d3636c7f13bc0936dc6bc1d2a69515f7d4d6
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-10 (Tue, 10 Jun 2014)

  Changed paths:
    M Dockerfile
    A contrib/docker/apache.conf
    A contrib/docker/apache.wsgi
    M contrib/docker/nginx.conf
    M contrib/docker/svc/ckan/run

  Log Message:
  -----------
  Switch to mod_wsgi in preference to gunicorn

As discussed previously, we're going to change one thing at a time so
this sticks to the default installation instructions and uses mod_wsgi
to run CKAN rather than gunicorn.

Also revert paths to the defaults (/etc/ckan/default,
/usr/lib/ckan/default, etc.)


  Commit: 9a7502449e40bc540960990e718adf80f9a9d78b
      https://github.com/ckan/ckan/commit/9a7502449e40bc540960990e718adf80f9a9d78b
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-11 (Wed, 11 Jun 2014)

  Changed paths:
    A ckan/config/solr/Dockerfile

  Log Message:
  -----------
  Add a Dockerfile for a simple CKAN Solr container

This adds a Dockerfile which can build a simple container running Solr
4.8.1 with a "ckan" core which uses the schema from the ckan/config/solr
directory.


  Commit: 7546504195498439c723517f6f7b3d5aef7341ed
      https://github.com/ckan/ckan/commit/7546504195498439c723517f6f7b3d5aef7341ed
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M doc/maintaining/installing/index.rst
    A doc/maintaining/installing/install-using-docker.rst

  Log Message:
  -----------
  Add documentation on installing with Docker

Adds a page to the installation documentation explaining how to use and
customise the Docker image. Note that not all of the commands listed
here will work until we merge the Dockerfile and configure the building
of the image on the Docker Hub.


  Commit: c0925818ec7c099925fa1af41e8427072132242d
      https://github.com/ckan/ckan/commit/c0925818ec7c099925fa1af41e8427072132242d
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-23 (Mon, 23 Jun 2014)

  Changed paths:
    R ckan/config/solr/Dockerfile
    A contrib/docker/postgresql/Dockerfile
    A contrib/docker/solr/Dockerfile
    A contrib/docker/solr/schema.xml
    M contrib/docker/svc/ckan/run
    M doc/maintaining/installing/install-using-docker.rst

  Log Message:
  -----------
  Update instructions to use containerised Solr/Pg by default

Getting CKAN to talk to Postgres and Solr on the Docker host is
perfectly possible, but explaining how to set up appropriate routes in
iptables is outside the scope of the CKAN installation docs.

This commit updates the CKAN run script to support connection to Pg and
Solr through Docker links, and updates the documentation accordingly.


  Commit: 74a33767f33da960465981fb40b04d752ad75d3b
      https://github.com/ckan/ckan/commit/74a33767f33da960465981fb40b04d752ad75d3b
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-24 (Tue, 24 Jun 2014)

  Changed paths:
    M contrib/docker/svc/postfix/run

  Log Message:
  -----------
  docker: Initialise postfix correctly

Postfix initialisation is a bit more complicated than the service file assumed
and doesn't actually work due to pieces missing from the chroot. Delegate to
the sysv init script and tail the log to keep the process running.

This is potentially a problem if postfix crashes and doesn't come back, but I
reckon finding a crashing bug in postfix is a few orders of magnitude less
likely than finding a similar bug in CKAN.


  Commit: ee82e01b22963c97401c2deec92179d26bcc9b1f
      https://github.com/ckan/ckan/commit/ee82e01b22963c97401c2deec92179d26bcc9b1f
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-27 (Fri, 27 Jun 2014)

  Changed paths:
    M contrib/docker/nginx.conf

  Log Message:
  -----------
  docker: Explicitly set nginx types_hash_bucket_size

As discovered by the inimitable bug-hunter @nigelbabu, on the version of
Nginx in the image, the value of types_hash_bucket_size is set at
runtime to the processor cache line size.

This means that on hardware with small cache lines (16 bytes) the image
can fail to start with:

    nginx: [emerg] could not build the types_hash, you should increase
    either types_hash_max_size: 1024 or types_hash_bucket_size: 32

This commit sets types_hash_bucket_size and types_hash_max_size to the
values used by latest Nginx (1.7.2 at the time of writing).


  Commit: 11dd3b236c12a7ca0de9f4b1ff783ddff67305fc
      https://github.com/ckan/ckan/commit/11dd3b236c12a7ca0de9f4b1ff783ddff67305fc
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M doc/maintaining/installing/install-using-docker.rst

  Log Message:
  -----------
  docs: Add note about requirement of Docker>=1.0

The built images don't appear to work with Docker<0.10.0, in particular
not with the version of Docker that currently ships as "docker.io" in
the Ubuntu 14.04 repositories.

The install instructions do link directly to the official install docs
for Docker, which don't recommend the distro packages, but we make this
explicit now in a callout at the top of the page.


  Commit: c7f8526060164f8c5d6a613d35bde719be79ed58
      https://github.com/ckan/ckan/commit/c7f8526060164f8c5d6a613d35bde719be79ed58
  Author: Nick Stenning <nick at whiteink.com>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M doc/maintaining/installing/install-using-docker.rst

  Log Message:
  -----------
  docs: Explicitly note omission of DataStore/DataPusher

Support for these parts of CKAN will come in a future PR.


  Commit: de550a7222b27fa61835526245ef34f21abe8541
      https://github.com/ckan/ckan/commit/de550a7222b27fa61835526245ef34f21abe8541
  Author: Nigel Babu <nigelbabu at gmail.com>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    A Dockerfile
    A contrib/docker/apache.conf
    A contrib/docker/apache.wsgi
    A contrib/docker/main.cf
    A contrib/docker/nginx.conf
    A contrib/docker/postgresql/Dockerfile
    A contrib/docker/solr/Dockerfile
    A contrib/docker/solr/schema.xml
    A contrib/docker/svc/ckan/run
    A contrib/docker/svc/nginx/run
    A contrib/docker/svc/postfix/run
    M doc/maintaining/installing/index.rst
    A doc/maintaining/installing/install-using-docker.rst

  Log Message:
  -----------
  Merge pull request #1755 from nickstenning/docker

[#1766] Dockerfile for CKAN


Compare: https://github.com/ckan/ckan/compare/b8943a21c5c0...de550a7222b2


More information about the ckan-changes mailing list