OpenStack Images¶
OpenStack image Dockerfiles are built from the repository root and reuse the
common helper scripts in scripts/.
The build is split into two stages:
The
venv_builderbase image is prepared withscripts/build_venv_builder.sh.Each service image builds a virtual environment from
BASE_VENV_BUILDERwithscripts/build_venv.sh, then builds the runtime layer fromBASE_RUNTIMEwithscripts/build_runtime.sh.
Common scripts used by these builds:
scripts/build_base.shbuilds the base runtime image used by OpenStack service images.scripts/build_venv_builder.shbuilds thevenv_builderimage that provides the headers and build dependencies needed to compile Python packages.scripts/build_venv.shruns in the first stage of an OpenStack image build and creates the virtual environment that is copied into the runtime stage.scripts/build_runtime.shruns in the second stage of an OpenStack image build and prepares the final runtime image.
All of these scripts source scripts/helpers.sh, which provides the reusable
bash functions used for package installation, apt configuration, project
checkout, cleanup, and image metadata collection.
Package selection is driven by bindep data files:
bindep.txtdefines binary packages used by runtime builds.pydep.txtdefines Python packages used by venv builds.
To add packages, either extend the relevant profiles in bindep.txt or
pydep.txt, or add packages directly in the Dockerfile with
DIST_PACKAGES for system packages and PIP_PACKAGES for Python
packages.
Build the shared images first:
docker build -f venv_builder/Dockerfile \
-t quay.io/airshipit/venv_builder:local \
.
docker build -f base/Dockerfile \
-t quay.io/airshipit/base:local \
.
The pages below show per-image commands. Override PROJECT_REF,
BASE_VENV_BUILDER, and BASE_RUNTIME as needed.