This repository contains docker images we use regularly, mainly in concourse pipelines.
- Build and publish images automatically based on new releases of installed software and the base operating system.
- Version all images according to the predominant software install.
- Keep images small (only install what we need).
This approach starts with a base image, ubuntu-base
, and builds by adding a single github release onto each image. By defining the base image and the single release, builds trigger automatically and cascade updates appropriately. Images also remain small.
Here is an example:
ubuntu-cf
primarily provides the Cloud Foundry CLI- The base image is
ubuntu-jq
asjq
is often used in conjunction with the CLI for processing json - The
ubuntu-jq
base image isubuntu-base
- The
ubuntu-base
base image is the Canonical supportedubuntu
withcurl
andzip
added (we use these a lot so they are good candidates for the base image).
This means a change in:
cf
will rebuildubuntu-cf
jq
will rebuildubuntu-jq
andubuntu-cf
ubuntu
(the base image from Canonical) will rebuildubuntu-base
,ubuntu-jq
, andubuntu-cf
To make this all work, the pipeline resources are based on github releases. We do not use apt to install things like jq
as we want concourse to trigger on new github releases.
If you want to set up (or extend) a similar build system for images, there are two relevant pipeline.yml
definitions.
ubuntu-base/pipeline.yml
builds the base image.ubuntu-with-github-release/pipeline.yml
builds all the other images. This is thepipeline.yml
you would use to add a new image with a new github release.
By using the same ubuntu-with-github-release/pipeline.yml
, you only have to define two inputs:
config.yml
contains the configuration for your imageDockerfile
defines your image
Therefore, you can:
- create a directory for your image:
ubuntu-<some-release>
- define a
config.yml
- add your
Dockerfile
You can then create a pipeline for your image with something like:
fly -t $target sp -p ubuntu-<some-release> -c ${this_directory}/ubuntu-with-github-release/pipeline.yml -l ${this_directory}/ubuntu-<some-release>/config.yml
You can also look at set-pipelines.sh
if you want to take the approach of being able to quickly recreate pipelines.