build script is included that builds the image and runs basic tests against the resulting image tags. The script is used in the continuous integration process (check out the CircleCI badge link above). But you can run this script locally to build your own images. Be sure to check out the environment variables that can be tweaked at the top of the
build script file.
The image is built using a builder Docker container based on the
debian image. This builder image lives in the
builder sub-directory of the project and uses a
mkimage-alpine.sh script to generate an Alpine Linux
rootfs.tar.xz file. This file then gets copied to the root of the project so we can build the main Alpine Linux image by just using the
ADD command to automatically untar the components to the resulting image.
The build script takes a glob of
options files as an argument. Each of these files lives in a folder that describes the version of Alpine Linux to build. Each line of the
options file are the options that will be applied to the resulting image. By default, we use the included glob of
Each options file specifies a version of the image to build. An options file can generate images for multiple architectures using the
To build all the images simply run:
Pass version files to the
build script to build specific versions:
$ ./build version/library-3.2/options versions/gliderlabs-3.2/options
parallel available you can speed up building a bit:
$ parallel -m ./build ::: versions/**/options
There is only one difference between the
gliderlabs/alpine image and the official Alpine Linux image in the Docker Library today. The
gliderlabs/alpine image has an
apk-install script added to it. However, this script is now considered deprecated as the
apk utility has the same functionality built-in (using
apk --no-cache). We now recommend using the official
alpine images unless you were already using
The test for images is very simple at the moment. It just attempts to install the
openssl package and verify we exit cleanly.
test sub-command of the
build utility to run tests on currently build images (
Run tests for a single image:
$ ./build test versions/gliderlabs-3.2/options ✓ version is correct ✓ package installs cleanly ✓ timezone ✓ apk-install script should be available ✓ repository list is correct ✓ cache is empty ✓ root password is disabled 7 tests, 0 failures
Run all tests:
$ ./build test ✓ version is correct ✓ package installs cleanly ✓ timezone ... ✓ apk-install script should be missing ✓ repository list is correct ✓ cache is empty ✓ root password is disabled 84 tests, 0 failures
Run tests in parallel with the
$ parallel ./build test ::: versions/**/options 1..7 ok 1 version is correct ok 2 package installs cleanly ok 3 timezone ok 4 apk-install script should be available ...
These are the steps we use for updating the official library image:
- Merge the
release. This will trigger CircleCI to push resulting image tarballs to the
rootfs/*branches and push the
gliderlabsorganization images directly to Docker Hub.
- Verify the build is green in CircleCI.
- Fork the official images repository and clone it locally if you have not already done so.
- Create a new local branch in the
docker-library/official-imagesrepository for the update to alpine.
- Open the
./build libraryfrom the
gliderlabs/docker-alpinefolder root to copy the latest version references.
- Paste in the updated version references to the
library/alpinefile opened in the
- Commit and push the changes to your fork.
- Open a pull request to the official images repository.