Docker image configuration and management for Wikimedia Toolforge.
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -U pip
$ pip install -U -r requirements.txt
$ ./build.py --push php/web
- Create a
Dockerfile.templatein the appropriate directory. - Add a
.dockerignoreto exclude the template from being imported into the container. - Add the image name to
IMAGESinbuild.py. - Profit!
Dockerfile.template files should use {registry} and {image_prefix}
parameters to adapt to the command line options provided when running
build.py.
- Each Dockerfile should only use
apt-get installonce. This rule can be bent if some packages need to come from pinned repositories (e.g. jessie-backports), but that may imply that an intermediate image is more appropriate. - Packages should be listed one per line and sorted in alphabetical order.
- Each
apt-get installshould be preceded by anapt-get updateand followed by anapt-get clean. See base/Dockerfile.template for an example.