Edit online

Creating a Docker Image for the Oxygen Publishing Engine

Read time: 3 minute(s)

Docker is a platform used to build, share, and run portable application containers.

While the Oxygen Publishing Engine does not provide a docker image by default, such an image can be constructed quite easily based on the instructions in the DITA Open Toolkit documentation.

A sample Docker configuration file for the Oxygen Publishing Engine is included in the Oxygen XML Blog project. Characteristics of the Docker configuration file:
  • Installs Java 17.
  • Downloads the Oxygen Publishing Engine.
  • Sets up a script that will provide the license key to the publishing engine using the LICENSE_KEY environmental variable.
Steps to use the sample Docker configuration file:
Build a Docker Image
Assuming you have installed Docker, open a console or terminal on a Mac or Linux system, "cd" to the folder where the Dockerfile configuration file is located, and run the command:
docker image build -t oxygen-publishing-engine:1.0 .
Running a Container Using the Docker Image
Assuming you have obtained a license key to use the Oxygen Publishing Engine commercially, you can paste the license key in a licensekey.txt file, then provide the license key content as an environmental variable to the docker image. Other provided parameters are the mapped folder from where the Docker container should obtain the DITA XML content, the image name and version, and parameters that get sent to the dita command for publishing. The container is automatically removed from Docker once finished as the produced output is already saved on the shared volume.
$: docker run -e LICENSE_KEY="$(<licensekey.txt)" \
--rm --name dita-ot-publish\
-v /Users/.../samples/dita/flowers:/src  \
oxygen-publishing-engine:1.0 \
-i /src/flowers.ditamap \
-o /src/out \
-f webhelp-responsive -v