Type: New Feature
Affects Version/s: None
With this ticket we now have:
- A way to build a Nuxeo Docker image, see below.
- The Nuxeo Server Docker image built this way. It is still called nuxeo/nuxeo but will be called nuxeo/slim once the Content Platform image (including OSS converters and packages) is ready, see
Build time vs runtime
Compared to the official image, we want to have an image configured at build time instead of runtime.
Hence, the main changes in the Content Platform Docker image would be:
- Remove the nuxeo.conf template and use by default the nuxeo.conf provided by the Nuxeo distribution, moved from NUXEO_SERVER/bin/nuxeo.conf to /etc/nuxeo/nuxeo.conf (unless /etc/nuxeo/nuxeo.conf is already mounted).
- Mount the following directories as volumes in the Dockerfile:
and set the corresponding nuxeo.conf properties in the docker-entrypoint to point to these volumes (if /etc/nuxeo/nuxeo.conf isn't already mounted):
- Set additional nuxeo.conf properties in the docker-entrypoint (if /etc/nuxeo/nuxeo.conf isn't already mounted):
- Remove the ability to use /docker-entrypoint-initnuxeo.d for:
- nuxeo.conf properties
- ZIP packages
- shell scripts
- Remove runtime configuration abilities via environment variables:
and all the other ones taken into account in the nuxeo.conf template from the official Docker image build.
Only NUXEO_CLID is kept.
How to build a Nuxeo Docker image
Let's use a multi-stage build relying on 2 images:
- A nuxeo/builder image providing:
- A Nuxeo server distribution with appropriate permissions in the /distrib directory.
- An install-packages.sh script to install Nuxeo packages.
- A nuxeo/base image based on CentOS 7, including:
- OpenJDK 11.
- A nuxeo user with a fixed uid (900).
- The directories required to have the configuration, data and logs outside of the server directory, with appropriate permissions.
- An entrypoint script to configure the server.
- The default recommended volumes.
- The environment variables required by the server.
To build an image containing a Nuxeo server distribution and some packages installed, let's use a multi-stage build with the nuxeo/builder image and the nuxeo/base image as a base, as in the following sample Dockerfile:
The install-packages.sh script should:
- Delete NUXEO_SERVER/packages/backup and NUXEO_SERVER/packages/tmp.
- Keep only NUXEO_SERVER/packages/.packages and NUXEO_SERVER/packages/store to be able to list packages.
- We could eventually delete everything related to Nuxeo Wizard in the builder stage.
- Later on, we should think about reworking/removing the package manager (Nuxeo launcher) from the distribution.