All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Li-Wen Hsu" <lwhsu@freebsd.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>, "Kevin Wolf" <kwolf@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Qiuhao Li" <Qiuhao.Li@outlook.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Yonggang Luo" <luoyonggang@gmail.com>,
	"Ed Maste" <emaste@freebsd.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	qemu-arm@nongnu.org, "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-block@nongnu.org,
	"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
	"John Snow" <jsnow@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Alexander Bulekov" <alxndr@bu.edu>,
	"Hanna Reitz" <hreitz@redhat.com>, "Bandan Das" <bsd@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Darren Kenny" <darren.kenny@oracle.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Pavel Dovgalyuk" <pavel.dovgaluk@ispras.ru>
Subject: [PATCH 7/7] tests/gitlab: use kaniko to build images
Date: Fri, 24 Feb 2023 18:08:57 +0000	[thread overview]
Message-ID: <20230224180857.1050220-8-alex.bennee@linaro.org> (raw)
In-Reply-To: <20230224180857.1050220-1-alex.bennee@linaro.org>

Apparently the docker-in-docker approach has some flaws including
needing privileged mode to run and being quite slow. An alternative
approach is to use Google's kaniko tool. It also works across
different gitlab executors.

Following the gitlab example code we drop all the direct docker calls
and usage of the script and make a direct call to kaniko and hope the
images are cacheable by others.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 .gitlab-ci.d/container-template.yml | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/.gitlab-ci.d/container-template.yml b/.gitlab-ci.d/container-template.yml
index c434b9c8f3..c2d7950df8 100644
--- a/.gitlab-ci.d/container-template.yml
+++ b/.gitlab-ci.d/container-template.yml
@@ -1,22 +1,17 @@
 .container_job_template:
   extends: .base_job_template
-  image: docker:stable
+  image:
+    name: gcr.io/kaniko-project/executor:v1.9.0-debug
+    entrypoint: [""]
   stage: containers
-  services:
-    - docker:dind
   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 $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
+    - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
   script:
     - echo "TAG:$TAG"
     - echo "COMMON_TAG:$COMMON_TAG"
-    - ./tests/docker/docker.py --engine docker build
-          -t "qemu/$NAME" -f "tests/docker/dockerfiles/$NAME.docker"
-          -r $CI_REGISTRY/qemu-project/qemu
-    - docker tag "qemu/$NAME" "$TAG"
-    - docker push "$TAG"
-  after_script:
-    - docker logout
+    - /kaniko/executor
+          --reproducible
+          --context "${CI_PROJECT_DIR}"
+          --dockerfile "${CI_PROJECT_DIR}/tests/docker/dockerfiles/$NAME.docker"
+          --destination "${TAG}"
-- 
2.39.1



  parent reply	other threads:[~2023-02-24 18:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 18:08 [PATCH 0/7] testing/next: docker.py removal and kaniko updates Alex Bennée
2023-02-24 18:08 ` [PATCH 1/7] configure: expose the direct container command Alex Bennée
2023-02-27 11:18   ` Daniel P. Berrangé
2023-02-28 11:54   ` Philippe Mathieu-Daudé
2023-02-24 18:08 ` [PATCH 2/7] tests/dockerfiles: unify debian-toolchain references Alex Bennée
2023-02-27 11:14   ` Daniel P. Berrangé
2023-02-28 11:38   ` Philippe Mathieu-Daudé
2023-02-24 18:08 ` [PATCH 3/7] tests/lcitool: append user setting stanza to dockerfiles Alex Bennée
2023-02-28 10:38   ` Daniel P. Berrangé
2023-02-24 18:08 ` [PATCH 4/7] tests/docker: add USER stanzas to non-lci images Alex Bennée
2023-02-28 10:40   ` Daniel P. Berrangé
2023-02-28 11:43   ` Philippe Mathieu-Daudé
2023-02-28 11:45     ` Daniel P. Berrangé
2023-02-28 12:18     ` Alex Bennée
2023-02-28 12:21       ` Philippe Mathieu-Daudé
2023-02-24 18:08 ` [PATCH 5/7] tests/docker: use direct RUNC call to build containers Alex Bennée
2023-02-28 10:40   ` Daniel P. Berrangé
2023-02-28 11:55   ` Philippe Mathieu-Daudé
2023-02-24 18:08 ` [PATCH 6/7] tests/docker: use direct RUNC call to run test jobs Alex Bennée
2023-02-28 10:45   ` Daniel P. Berrangé
2023-02-24 18:08 ` Alex Bennée [this message]
2023-02-28 10:53   ` [PATCH 7/7] tests/gitlab: use kaniko to build images Daniel P. Berrangé
2023-02-28 11:58 ` [PATCH 0/7] testing/next: docker.py removal and kaniko updates Philippe Mathieu-Daudé
2023-02-28 12:58   ` Daniel P. Berrangé
2023-02-28 13:29     ` Philippe Mathieu-Daudé
2023-02-28 13:34       ` Daniel P. Berrangé
2023-02-28 13:57         ` Alex Bennée
2023-02-28 14:33           ` Philippe Mathieu-Daudé

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=20230224180857.1050220-8-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=Qiuhao.Li@outlook.com \
    --cc=alxndr@bu.edu \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=bsd@redhat.com \
    --cc=crosa@redhat.com \
    --cc=darren.kenny@oracle.com \
    --cc=emaste@freebsd.org \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=kwolf@redhat.com \
    --cc=luoyonggang@gmail.com \
    --cc=lwhsu@freebsd.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.