From: Camilla Conte <cconte@redhat.com>
To: qemu-devel@nongnu.org
Cc: Camilla Conte <cconte@redhat.com>,
berrange@redhat.com, richard.henderson@linaro.org,
alex.bennee@linaro.org
Subject: [PATCH] gitlab-ci: Replace Docker with Kaniko
Date: Thu, 16 May 2024 17:52:43 +0100 [thread overview]
Message-ID: <20240516165410.28800-3-cconte@redhat.com> (raw)
Enables caching from the qemu-project repository.
Uses a dedicated "$NAME-cache" tag for caching, to address limitations.
See issue "when using --cache=true, kaniko fail to push cache layer [...]":
https://github.com/GoogleContainerTools/kaniko/issues/1459
Does not specify a context since no Dockerfile is using COPY or ADD instructions.
Does not enable reproducible builds as
that results in builds failing with an out of memory error.
See issue "Using --reproducible loads entire image into memory":
https://github.com/GoogleContainerTools/kaniko/issues/862
Previous attempts, for the records:
- Alex Bennée: https://lore.kernel.org/qemu-devel/20230330101141.30199-12-alex.bennee@linaro.org/
- Camilla Conte (me): https://lore.kernel.org/qemu-devel/20230531150824.32349-6-cconte@redhat.com/
Signed-off-by: Camilla Conte <cconte@redhat.com>
---
.gitlab-ci.d/container-template.yml | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/.gitlab-ci.d/container-template.yml b/.gitlab-ci.d/container-template.yml
index 4eec72f383..066f253dd5 100644
--- a/.gitlab-ci.d/container-template.yml
+++ b/.gitlab-ci.d/container-template.yml
@@ -1,21 +1,18 @@
.container_job_template:
extends: .base_job_template
- image: docker:latest
stage: containers
- services:
- - docker:dind
+ image:
+ name: gcr.io/kaniko-project/executor:debug
+ entrypoint: [""]
+ variables:
+ DOCKERFILE: "$CI_PROJECT_DIR/tests/docker/dockerfiles/$NAME.docker"
+ CACHE_REPO: "$CI_REGISTRY/qemu-project/qemu/qemu/$NAME-cache"
before_script:
- export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:$QEMU_CI_CONTAINER_TAG"
- # Always ':latest' because we always use upstream as a common cache source
- - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
- - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- - until docker info; do sleep 1; done
script:
- echo "TAG:$TAG"
- - echo "COMMON_TAG:$COMMON_TAG"
- - docker build --tag "$TAG" --cache-from "$TAG" --cache-from "$COMMON_TAG"
- --build-arg BUILDKIT_INLINE_CACHE=1
- -f "tests/docker/dockerfiles/$NAME.docker" "."
- - docker push "$TAG"
- after_script:
- - docker logout
+ - /kaniko/executor
+ --dockerfile "$DOCKERFILE"
+ --destination "$TAG"
+ --cache=true
+ --cache-repo="$CACHE_REPO"
--
2.45.0
next reply other threads:[~2024-05-16 17:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 16:52 Camilla Conte [this message]
2024-05-16 18:24 ` [PATCH] gitlab-ci: Replace Docker with Kaniko Daniel P. Berrangé
2024-05-17 6:24 ` Thomas Huth
2024-05-17 7:37 ` Daniel P. Berrangé
2024-05-17 8:14 ` Daniel P. Berrangé
2024-05-20 16:56 ` Camilla Conte
2024-05-22 10:46 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240516165410.28800-3-cconte@redhat.com \
--to=cconte@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).