Changing the base image used for Apama Docker images

Apama ships pre-built Docker images via several public registries, including Docker Hub and Amazon Marketplace. These are based upon CentOS 7 base images. Some users may want to use a different base OS, for size reasons, support, or access to more recent compilers. Apama supports a wide selection of Linux distribution on-premise, but by default only ships one version of Docker images.

However, we do have a Docker build posted on Github which will take official Apama base images and change them to use a different base OS.

Building new Apama images

Context is irrelevant for this Dockerfile, it’s all contained within the Dockerfile and the original images that are being rebuilt from, so you can build it directly from Github. The Dockerfile exposes several build arguments which can be used to tailor your new images:

  • BASE_OS – This must always be set to the Docker repository and tag of the base OS you want to use
  • APAMA_VERSION – This must always be set to the 2-digit version of Apama which is being rebuilt
  • APAMA_IMAGE – By default, the Dockerfile will use the ${APAMA_VERSION} correlator image from Docker Hub. To rebuild the builder image, or to pull images from another location, set this to the full registry/repository:image of the source image to use.

For example, to rebuild the 10.3 Docker Hub Apama image using the latest Ubuntu as a base image you would run:


docker build -t apama-correlator:ubuntu \
 --build-arg BASE_OS=ubuntu \
 --build-arg APAMA_VERSION=10.3 \
 https://github.com/SoftwareAG/apama-streaming-analytics-docker-base.git

Alternatively, to rebuild the Apama builder image from Docker Hub you would run:


docker build -t apama-builder:ubuntu \
 --build-arg BASE_OS=ubuntu \
 --build-arg APAMA_VERSION=10.3 \
 --build-arg APAMA_IMAGE=softwareag/apama-builder:10.3 \
 https://github.com/SoftwareAG/apama-streaming-analytics-docker-base.git

Testing the new images

The Dockerfile also comes with a second Docker project which will test the images built above under the tests directory. To use it you should build a second image setting the tags of your images as arguments to that build process. That build file has two build arguments:

  • APAMA_IMAGE – The tag of the apama-correlator image. It defaults to the image from Docker Hub.
  • APAMA_BUILDER – The tag of the apama-builder image. It defaults to the image from Docker Hub.

To run these tests you’ll probably want to check out the Git repository and run it from the working copy. For example, if you just rebuilt the correlator image you could run it like:


docker build -t test-ubuntu-correlator \
 --build-arg APAMA_IMAGE=apama-correlator:ubuntu tests

If the build completes successfully then the tests have passed.

Further reading

This documentation is reproduced on the Github project. You can also ask questions on Stack Overflow using the apama tag.