Files
scylladb/tools/toolchain
Avi Kivity 835ad406de tools: toolchain: update docker build command to include --no-cache
If docker sees the Dockerfile hasn't changed it may reuse an old image, not
caring that context files and dependent images have in fact changed. This can
happen for us if install-dependencies.sh or the base Fedora image changed.

To make sure we always get a correct image, add --no-cache to the build command.
Message-Id: <20190122185042.23131-1-avi@scylladb.com>
2019-01-23 10:47:40 +01:00
..
2019-01-03 16:16:47 +02:00

Official toolchain for ScyllaDB

While we aim to build out-of-the-box on recent distributions, this isn't always possible and not everyone runs a recent distribution. For this reason a version-controlled toolchain is provided as a docker image.

Obtaining the current toolchain

The toolchain is stored in a file called tools/toolchain/image. To access the toolchain, pull that image:

docker pull $(<tools/toolchain/image)

A helper script dbuild allows you to run command in that toolchain with the working directory mounted:

./tools/toolchain/dbuild ./configure.py
./tools/toolchain/dbuild ninja

You can adjust the docker run command by adding more flags before the command to be executed, separating the flags and the command with --. This can be useful to attach more volumes (for data or ccache) and to set environment variables:

./tools/toolchain/dbuild -v /var/cache/ccache:/var/cache/ccache -- ninja

Building the toolchain

Run the command

docker build --no-cache -f tools/toolchain/Dockerfile .

and use the resulting image.

Publishing an image

If you're a maintainer, you can tag the image and push it using docker push. Tags follow the format scylladb/scylla-toolchain:fedora-29-[branch-3.0-]20181128. After the image is pushed, update tools/toolchain/image so new builds can use it automatically.

For master toolchains, the branch designation is omitted. In a branch, if there is a need to update a toolchain, the branch designation is added to the tag to avoid ambiguity.