These are the strategies we use for managing docker images in the
digitalmarketplace DockerHub repo
Most of our docker images are automatically managed by Jenkins jobs that run when a particular repo has changes merged to master.
As part of the release-pipeline job these include:
As part of the build-scripts job:
The above jobs use a build-image job when code is merged to master in their respective git repositories.
The build-image job:
- Checks out the master branch of the repository
- Builds the docker image from the Dockerfile in the repo
- Tags the docker image with the PR number
- Pushes the tag
- Tags and pushes the build as
The build-scripts job is a good example of how to add a docker image for a repo that will then be automatically managed.
- Add the
Dockerfileto the base of the
- Create a repo for the docker image on dockerhub like
digitalmarketplace/<repo-name>(find the credentials in
- Add a jenkins job that polls github for changes to
digitalmarketplace/<repo-name>:masterwhich runs the build-image job
We have three base images in the digitalmarketplace-docker-base repository:
These are updated using
make commands found in the repo’s Makefile.
You can find out more about how to update them in the repo’s README.
it is worth reviewing whether you can incorporate a new docker image in to any of the other strategies before using a
Dockerfile managed docker image. It is likely that your code should be a new repo if it requires its own
In that case it is possible to use the automatically managed strategy.
There are a couple of Docker images we create and use that do not fit into any of the categories above. These processes are considered technical debt however; it is an ongoing issue to look at better tools for this kind of thing.
As part of the Jenkins manual job, we build and push a Docker image which is then used to build this manual.
You can find out more about the backups in the Database backups section of the manual.