Dockerfile customization
This topic explains how to customize Docker file in Release.
It is likely that you might need to customize your Docker file for certain purposes which include but aren't limited to:
- Connecting to a proprietary database (DB2, Oracle, etc.)
- Adding a hotfix as instructed by our support team
- Adding a custom plugin
Here's how you can customize a Docker image for your needs:
When you create a Dockerfile with custom resources added, always remember that the owning user:group combination must be 10001:0
.
Certain JARS should be placed in specific paths only. You shouldn't add ab Oracle JAR to the ext/
folder, for example. If you are unsure where a JAR should be added, please get in touch with our support team.
${APP_HOME}
points to the path /opt/xebialabs/xl-deploy-server
by default
To begin, create a Dockerfile that resembles the following configuration:
FROM xebialabs/xl-release:9.5.0
###################################################################################
# PLUGINS #
# Plugins should be placed under ${APP_HOME}/default-plugins/ #
###################################################################################
COPY --chown=10001:0 files/xlr-delphix-plugin-9.0.0.jar /opt/xebialabs/xl-release-server/default-plugins/xlr-official/
# Add plugin from url
ADD --chown=10001:0 https://github.com/xebialabs-community/xlr-github-plugin/releases/download/v1.5.2/xlr-github-plugin-1.5.2.jar /opt/xebialabs/xl-release-server/default-plugins/__local__/
##########################################################################
# EXTENSIONS #
# Extensions should be placed under ${APP_HOME}/ext
##########################################################################
ADD --chown=10001:0 files/ext /opt/xebialabs/xl-release-server/ext/
##########################################################################
# HOTFIXES #
##########################################################################
ADD --chown=10001:0 files/hotfix.jar /opt/xebialabs/xl-release-server/hotfix/
##########################################################################
# LIBRARIES #
##########################################################################
ADD --chown=10001:0 files/ojdbc6.jar /opt/xebialabs/xl-release-server/lib/
All official Release plugins must be placed under default-plugins/xlr-official/
folder, while custom or community plugins must be placed under default-plugins/__local__/
For an overview of how ADD
and COPY
works, see the documentation
Once you are satisfied with your Dockerfile, run the following command in the same directory
docker build -t xl-release-custom:9.5.0 .
This command will build and tag a docker image for you.
Always use semver to version your docker images.
To run this image locally, use the following command:
docker run -it --rm -p 5516:5516 -e "ADMIN_PASSWORD=desired_admin_password" -e ACCEPT_EULA=Y xl-release-custom:9.5.0
If you would like to host the Docker image elsewhere, you have two options:
Recommended:
- Push this image to a Docker registry of your choice. You can either set up your own registry, or use an offering from DockerHub, AWS, GCP and many others. The simplest way of achieving this is to simply run
docker tag xl-release-custom:9.5.0 yourdockerhuborg/xl-release-custom:9.5.0
docker push yourdockerhuborg/xl-release-custom:9.5.0
- (On the node you would like to run the container)
docker run -it --rm -p 5516:5516 -e "ADMIN_PASSWORD=desired_admin_password" -e ACCEPT_EULA=Y yourdockerhuborg/xl-release-custom:9.5.0
Not recommended:
2. By using docker export
and docker load
. This approach is not recommended, as it requires you to move a tar file between different machines.