-
Type: New Feature
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: CI/CD
-
Epic Link:
-
Tags:
-
Backlog priority:5
-
Sprint:nxplatform 11.1.16, nxplatform 11.1.17, nxplatform 11.1.18, nxplatform 11.1.19, nxplatform 11.1.20
-
Story Points:5
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
NXP-28133.
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:
/var/lib/nuxeo/data /var/log/nuxeo /tmp
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):
nuxeo.data.dir=/var/lib/nuxeo/data nuxeo.log.dir=/var/log/nuxeo nuxeo.tmp.dir=/tmp
- Set additional nuxeo.conf properties in the docker-entrypoint (if /etc/nuxeo/nuxeo.conf isn't already mounted):
# Set java.io.tmpdir = ${nuxeo.tmp.dir} launcher.override.java.tmpdir=true # No wizard nuxeo.wizard.done=true
- Remove the ability to use /docker-entrypoint-initnuxeo.d for:
- nuxeo.conf properties
- ZIP packages
- shell scripts
- CLID
- Remove runtime configuration abilities via environment variables:
NUXEO_CUSTOM_PARAM (add custom parameters to nuxeo.conf) NUXEO_INSTALL_HOTFIX NUXEO_PACKAGES
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:
FROM nuxeo/builder:VERSION as builder COPY local/packages /packages RUN install-packages.sh /packages FROM nuxeo/base:VERSION RUN yum -y install ... COPY --from=builder --chown=900:0 /distrib $NUXEO_HOME USER 900
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.
Extras:
- 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.
- depends on
-
NXBT-3021 Builders: allow COPY with skaffold when the source directory is empty
- Resolved
-
NXP-27505 Build the Nuxeo Server Docker Image
- Resolved
-
NXP-27923 Reduce waste space on Nuxeo Server Docker image
- Resolved
-
NXP-28069 Fully mavenize Nuxeo Content Platform Docker image build
- Resolved
- is related to
-
NXP-28573 Allow to install packages in the Nuxeo Docker image at runtime
- Resolved
-
NXP-28139 Improve Cloud Docker image logging
- Resolved
-
NXP-28145 Allow some runtime configuration in Nuxeo Docker images
- Resolved
-
NXP-28146 Better system for environment specific application configuration
- Resolved
- is required by
-
NXP-28123 Build and deploy Content Cloud Docker Image
- Resolved
-
NXP-28133 Build and deploy Content Platform Docker image
- Resolved
-
NXP-28150 Add a README about the Nuxeo Docker images
- Resolved