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-cfprimarily provides the Cloud Foundry CLI- The base image is
ubuntu-jqasjqis often used in conjunction with the CLI for processing json - The
ubuntu-jqbase image isubuntu-base - The
ubuntu-basebase image is the Canonical supportedubuntuwithcurlandzipadded (we use these a lot so they are good candidates for the base image).
This means a change in:
cfwill rebuildubuntu-cfjqwill rebuildubuntu-jqandubuntu-cfubuntu(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.ymlbuilds the base image.ubuntu-with-github-release/pipeline.ymlbuilds all the other images. This is thepipeline.ymlyou 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.ymlcontains the configuration for your imageDockerfiledefines 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.