Customize a Docker Image to use it on Palace

Issue

  • We need some tools installed on the Docker image that we use for agents
  • We have some scripts that we execute on every build

Environment

  • CloudBees Jenkins Enterprise (CJE)

Resolution

You want to have a new Palace template with some additional software installed. In order to do that, you need to create a new Docker image. Your starting point can be any docker file extending from any of the Docker images shown below

openjdk
cloudbees/java-with-docker-client
maven:3.3-jdk-7
maven:3.3-jdk-8

If you are using a Palace Template that you want to use as base, you can find the Docker image used on its configure page, under the image field

Palace Template Configuration

Once you have chosen the base image (for example cloudbees/java-with-docker-client ) you have to create a Dockerfile for it. Please, review the sample below where we install subversion, curl ,and htop

FROM cloudbees/java-with-docker-client:latest

USER root
RUN apt-get update  -y
RUN apt-get install -y subversion curl htop

When you have the Dockerfile you can push the image to your Docker registry. Once that you have done it, you could use it on a Palace template. For more details on how to configure a Palace template, please review the links below.

Building pipelines on CloudBees Jenkins Enterprise

Using private Docker registries

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.