arangodb
arangodb copied to clipboard
Automate build docker container build
Scope & Purpose
Automate building of the build docker containers with CircleCI.
config.yml detects whether files in the directory scripts/docker have been changed, and
if so
- chooses a continuation (
docker_build.yml) that will build the docker images for x86 and arm and push them to a Elastic Container Registry - creates a manifest that contains both the x86 and arm64 images; this allows just using one image name for jobs in circleci and only changing the resource class to switch between arm and x86
- writes the generated tag into the file
BUILD_DOCKER_TAGin the root of the git repository - commits this change and pushes to the current branch
if not
- generates a continuation as before, but one that uses the
BUILD_DOCKER_TAGto build ArangoDB and run the tests. - In particular, if a developer changes the Dockerfile, the first step will update the docker image and one can then build and test ArangoDB with the new docker image on the respective PR. When that PR gets merged, all future PRs that branch off
develwill use the new image.
Why ECR and not docker.io?
ECR was chosen, because CircleCI hosts its infrastructure on AWS and therefore we expect fewer problems with test jobs failing because of failing downloads of docker images. The registry is public, and these docker images can be used by developers locally without login, too
What is the registry and can I see the image?
The registry is public.ecr.aws/b0b8h2r4, the image name is of the shape build-alpine:$ALPINE_VERSION-clang$CLANG_VERSION-gcc$GCC_VERSION-openssl$OPENSSL_VERSION-$(git rev-parse --short) where git is executed on the commit that changes the dockerfile.
How long will the docker images be kept?
This is to be determined. Docker Images incur storage cost and hence have to be cleaned up regularly. Docker images that are still in use for devel builds and (active) PRs/branches should not be deleted (too early).