summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Bennée2020-07-01 15:56:50 +0200
committerAlex Bennée2020-07-11 16:53:00 +0200
commitc8e6793903385fe30caf5d23eaed0d339f7aa6cb (patch)
treeee8df64c270fe0d65a9fd79111691860064827f5
parentgitlab: limit re-builds of the containers (diff)
downloadqemu-c8e6793903385fe30caf5d23eaed0d339f7aa6cb.tar.gz
qemu-c8e6793903385fe30caf5d23eaed0d339f7aa6cb.tar.xz
qemu-c8e6793903385fe30caf5d23eaed0d339f7aa6cb.zip
containers.yml: build with docker.py tooling
Instead of building the docker files directly use the same docker.py scripting as we do for building locally. This should help ensure we use the exact same steps and allow us to cache properly when building locally. To get this working you have to have a fairly recent docker binary otherwise you will see the error message: => ERROR importing cache manifest from registry.gitlab.... So far docker 19.03.12 works (from the docker apt repos) but 18.09.1, build 4c52b90 which is packaged in Debian Buster fails. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20200701135652.1366-39-alex.bennee@linaro.org>
-rw-r--r--.gitlab-ci.d/containers.yml11
1 files changed, 7 insertions, 4 deletions
diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
index ea350eacff..f3c0ca4d61 100644
--- a/.gitlab-ci.d/containers.yml
+++ b/.gitlab-ci.d/containers.yml
@@ -6,14 +6,17 @@
before_script:
- export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
- export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/$NAME:latest"
+ - apk add python3
- docker info
- docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
script:
+ - echo "TAG:$TAG"
+ - echo "COMMON_TAG:$COMMON_TAG"
- docker pull "$TAG" || docker pull "$COMMON_TAG" || true
- - sed -i -e "s,FROM qemu/,FROM $CI_REGISTRY_IMAGE/qemu/," tests/docker/dockerfiles/$NAME.docker
- - DOCKER_BUILDKIT=1 docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG"
- --build-arg BUILDKIT_INLINE_CACHE=1
- -f "tests/docker/dockerfiles/$NAME.docker" tests/docker/dockerfiles
+ - ./tests/docker/docker.py --engine docker build
+ -t "qemu/$NAME" -f "tests/docker/dockerfiles/$NAME.docker"
+ -r $CI_REGISTRY_IMAGE
+ - docker tag "qemu/$NAME" "$TAG"
- docker push "$TAG"
after_script:
- docker logout