[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 30/30] containers.yml: build with docker.py tooling
From: |
Alex Bennée |
Subject: |
[PATCH v3 30/30] containers.yml: build with docker.py tooling |
Date: |
Fri, 26 Jun 2020 19:13:57 +0100 |
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>
---
.gitlab-ci.d/containers.yml | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
index f56aa44f711..e332af3cc46 100644
--- a/.gitlab-ci.d/containers.yml
+++ b/.gitlab-ci.d/containers.yml
@@ -8,14 +8,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
--
2.20.1
- [PATCH v3 09/30] tests/vm: change scripts to use self._config, (continued)
- [PATCH v3 09/30] tests/vm: change scripts to use self._config, Alex Bennée, 2020/06/26
- [PATCH v3 18/30] gitlab: introduce explicit "container" and "build" stages, Alex Bennée, 2020/06/26
- [PATCH v3 12/30] tests/vm: switch from optsparse to argparse, Alex Bennée, 2020/06/26
- [PATCH v3 08/30] tests/vm: Added a new script for centos.aarch64., Alex Bennée, 2020/06/26
- [PATCH v3 10/30] python/qemu: Add ConsoleSocket for optional use in QEMUMachine, Alex Bennée, 2020/06/26
- [PATCH v3 11/30] tests/vm: Add workaround to consume console, Alex Bennée, 2020/06/26
- [PATCH v3 17/30] gitlab-ci: Fix the change rules after moving the YML files, Alex Bennée, 2020/06/26
- [PATCH v3 21/30] gitlab: build containers with buildkit and metadata, Alex Bennée, 2020/06/26
- [PATCH v3 13/30] tests/vm: allow us to take advantage of MTTCG, Alex Bennée, 2020/06/26
- [PATCH v3 30/30] containers.yml: build with docker.py tooling,
Alex Bennée <=
- [PATCH v3 16/30] .gitignore: un-ignore .gitlab-ci.d, Alex Bennée, 2020/06/26
- [PATCH v3 14/30] tests/docker: check for an parameters not empty string, Alex Bennée, 2020/06/26
- [PATCH v3 20/30] gitlab: convert jobs to use custom built containers, Alex Bennée, 2020/06/26
- [PATCH v3 26/30] gitlab: enable check-tcg for linux-user tests, Alex Bennée, 2020/06/26