docker-alpine :: index



A convenience 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 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 versions/**/options.


Each options file specifies a version of the image to build. An options file can generate images for multiple architectures using the ARCHS variable.


To build all the images simply run:

$ ./build

Pass version files to the build script to build specific versions:

$ ./build version/library-3.2/options versions/gliderlabs-3.2/options

With 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 gliderlabs/alpine.


The test for images is very simple at the moment. It just attempts to install the openssl package and verify we exit cleanly.

Use the test sub-command of the build utility to run tests on currently build images (build test).


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 utility:

$ parallel ./build test ::: versions/**/options
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:

  1. Merge the master branch into release and push release. This will trigger CircleCI to push resulting image tarballs to the rootfs/* branches and push the gliderlabs organization images directly to Docker Hub.
  2. Verify the build is green in CircleCI.
  3. Fork the official images repository and clone it locally if you have not already done so.
  4. Create a new local branch in the docker-library/official-images repository for the update to alpine.
  5. Open the library/alpine file from docker-library/official-images.
  6. Run ./build library from the gliderlabs/docker-alpine folder root to copy the latest version references.
  7. Paste in the updated version references to the library/alpine file opened in the docker-library/official-images local clone.
  8. Commit and push the changes to your fork.
  9. Open a pull request to the official images repository.