Customizing the docker container

Sometimes the provided docker container needs customization for the SDK to be fully utilized in development of the application.

This can be done in two different ways. Extension or replacement.

Refer to the Dockerfile documentation for more information on Dockerfiles.

Extending the docker container

To extend the existing docker container with more packages a new docker container can be defined that inherits from the default one.

The default container is called acu6-pro-sdk, so a new container based on it must inherit the default container.

For example, here we extend the default container to also contain clang

ARG ACU6_PRO_SDK_DOCKER_IMAGE_DEFAULT
FROM ${ACU6_PRO_SDK_DOCKER_IMAGE_DEFAULT}

RUN apt-get update && \
    apt-get install --no-install-recommends -y \
       clang

And to use the new docker container a few variables need to be exported in the user or template provided makefile.

DOCKER_EXTRA_IMAGES

shall contain a space separated list of absolute paths to the Dockerfiles followed by a colon, followed by the desired name and optionally tag for the docker container.

DOCKER_IMAGE_NAME

shall contain the name and optionally tag of the docker container to run.

For example, if the above Dockerfile is saved as Dockerfile in a sub-directory to files/ from the Project template, called docker. In this example we will call the new docker container acu6-pro-sdk-myext with tag 10.3.0.

The makefile exports would then look like:

export DOCKER_EXTRA_IMAGES = $(TOPDIR)/files/docker/Dockerfile:acu6-pro-sdk-myext:10.3.0
export DOCKER_IMAGE_NAME = acu6-pro-sdk-myext:10.3.0

To simplify the building of the extension docker image the SDK defines two docker build arguments with the version and the full tag of the base SDK docker images

ACU6_PRO_SDK_VERSION

is the version number of the SDK, for example 10.3.0

ACU6_PRO_SDK_DOCKER_IMAGE_DEFAULT

is the full name and tag of the base SDK image.

Replacing the docker container

It is also possible to replace the entire container in situations where extensions are infeasible.

To do a complete replacement the variable DOCKER_IMAGES is provided.

DOCKER_IMAGES works like DOCKER_EXTRA_IMAGES except that DOCKER_IMAGES takes a complete list of images. Meaning that the default container will not be built.

Using the same path example as in the extension chapter, and calling the docker container my-own-docker the resulting makefile exports would look like:

export DOCKER_IMAGES = $(TOPDIR)/files/docker/Dockerfile:my-own-docker
export DOCKER_IMAGE_NAME = my-own-docker