From 06b65d9919a6f0007cc347a75de6ab805635a4a9 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 15 May 2023 13:44:15 +0930 Subject: [PATCH 1/8] ci: update to current gitlab-ci project dev head incorporates changes from nofusscomputing/projects/gitlab-ci!17 !4 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9bc153a..4dd474d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ This project is hosted on [gitlab](https://gitlab.com/nofusscomputing/projects/d **Development Branch** -![Gitlab build status - development](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F45926238%2Fpipelines%3Fref%3Ddevelopment&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A//gitlab.com/nofusscomputing/projects/docker-buildx-qemu-%2Fraw%2Fdevelopment%2F.cz.yaml) +![Gitlab build status - development](https://img.shields.io/badge/dynamic/json?color=ff782e&label=Build&query=0.status&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F45926238%2Fpipelines%3Fref%3Ddevelopment&logo=gitlab&style=plastic) ![branch release version](https://img.shields.io/badge/dynamic/yaml?color=ff782e&logo=gitlab&style=plastic&label=Release&query=%24.commitizen.version&url=https%3A//gitlab.com/nofusscomputing/projects/docker-buildx-qemu%2F-%2Fraw%2Fdevelopment%2F.cz.yaml) ----
From 8ddf6194c41a0f0991d7a66b9730f77c64c99c68 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 20 May 2023 14:56:02 +0930 Subject: [PATCH 2/8] fix(docker): removed spt for armv7 and i386 docker-ce-cli not available for architecture !4 --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e30af7..ab29b8d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,10 @@ variables: #JOB_STOP_GIT_PUSH_MIRROR: 'disable for testing' #JOB_STOP_GITLAB_RELEASE: 'disable for testing' - DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6" + DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/arm/v7" + # Package docker-ce-cli is not available for: + # - linux/arm/v6 + # - linux/386 DOCKER_IMAGE_PUBLISH_NAME: $CI_PROJECT_NAME DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME From 698002d9f48f7ca1f033aeec2fc848646f177e6d Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 20 May 2023 15:02:44 +0930 Subject: [PATCH 3/8] fix(qemu): segfault on arm no longer occurs qemu was segfaulting with: ``` Processing triggers for libc-bin (2.31-13+deb11u6) ... qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault (core dumped) qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault (core dumped) dpkg: error processing package libc-bin (--configure): installed libc-bin package post-installation script subprocess returned error exit status 139 ``` so qemu was removed from the image !4 --- Dockerfile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4be7b83..3158013 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,7 @@ -FROM debian +FROM debian:11.7 - -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt-get update && apt --fix-broken install \ - && apt install -y libc-bin locales-all - +ARG DEBIAN_FRONTEND=noninteractive RUN export DEBIAN_FRONTEND=noninteractive \ @@ -17,17 +13,15 @@ RUN export DEBIAN_FRONTEND=noninteractive \ gnupg2 \ software-properties-common \ python3 \ - python3-pip || true + python3-pip -# Install Docker and qemu RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ apt-get update && apt-get install -y \ docker-buildx-plugin \ docker-ce-cli \ - binfmt-support \ - qemu-user-static || true + binfmt-support=2.2.1-1+deb11u1 # Write version file From a00cfd60b887a0354638c97608b513f4cdafacd7 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 20 May 2023 15:22:06 +0930 Subject: [PATCH 4/8] ci: remove qemu from image !4 --- .gitlab-ci.yml | 160 ++++++++++++++++++++++++++++++++++++++++++++++++- Dockerfile | 19 ++++-- 2 files changed, 172 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab29b8d..0d8ab87 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,10 +17,168 @@ variables: #JOB_STOP_GIT_PUSH_MIRROR: 'disable for testing' #JOB_STOP_GITLAB_RELEASE: 'disable for testing' - DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/arm/v7" + #DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/arm/v7" + DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/arm64,linux/amd64,linux/arm/v7" # Package docker-ce-cli is not available for: # - linux/arm/v6 # - linux/386 DOCKER_IMAGE_PUBLISH_NAME: $CI_PROJECT_NAME DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME + + + + + + + +.build_docker_container: + stage: build + image: nofusscomputing/docker-buildx-qemu:dev + services: + - name: docker:23-dind + entrypoint: ["env", "-u", "DOCKER_HOST"] + command: ["dockerd-entrypoint.sh"] + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + DOCKER_DOCKERFILE: Dockerfile + # See https://github.com/docker-library/docker/pull/166 + DOCKER_TLS_CERTDIR: "" + before_script: + - if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi + - echo "[DEBUG] ROOT_DIR[$ROOT_DIR]" + + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - docker info + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + #- pip3 install -r gitlab-ci/gitlab_release/requirements.txt + - pip3 install setuptools wheel + - pip install -r $ROOT_DIR/conventional_commits/requirements.txt + - pip3 install gitlab-ci/gitlab_release/python-module/cz_nfc/. + + + # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 + - update-binfmts --display + - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel + #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use + - docker buildx create --driver=docker-container --use + - docker buildx inspect --bootstrap + # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache + # - /sbin/ldconfig && ls -la /var/cache/ldconfig + # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" + # - apt update + #- apt list --installed + + #- apt remove -y qemu-user-static + #- apt list --installed + + # - apt remove -y qemu-user-static + # - rm -f /var/cache/ldconfig/aux-cache + # - /sbin/ldconfig + # #- cp $(which qemu-aarch64-static) /usr/bin/qemu-aarch64 does nothing + # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 + # - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel + #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use + + # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache + # - /sbin/ldconfig && ls -la /var/cache/ldconfig + # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" + # - apt update + # - apt list --installed + # - apt install -y qemu-user-static=1:7.2+dfsg-7~bpo11+1 + # - apt remove -y qemu-user-static + + # - update-binfmts --display + # - apt list --installed + # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh + # - chmod +x /qemu-binfmt-conf.sh + # - mkdir -p /tester + # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin + # - update-binfmts --importdir=/tester --import + # - update-binfmts --enable + #- update-binfmts --display + # - docker buildx create --driver=docker-container --use + # - docker buildx inspect --bootstrap + # - apt list --installed + # - apt remove -y qemu-user-static + # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh + # - chmod +x /qemu-binfmt-conf.sh + # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" + # - apt update + # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 + # - mkdir -p /tester + # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin + # - update-binfmts --importdir=/tester --import + # - update-binfmts --enable + # - update-binfmts --display + + #- update-binfmts --enable + + + # --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ + # --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ + script: + #- update-binfmts --enable + - update-binfmts --display + - | + + if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then + + echo "[DEBUG] building multiarch/specified arch image"; + + docker buildx build --platform=$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS . \ + --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ + --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ + --label org.opencontainers.image.source="$CI_PROJECT_URL" \ + --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ + --push \ + --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ + --file $DOCKER_DOCKERFILE \ + --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; + + docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; + + # during docker multi platform build there are >=3 additional unknown images added to gitlab container registry. cleanup + + DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}{{ if ne (print .Platform) \"&{unknown unknown [] }\" }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }}{{end}} {{end}}"); + + docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; + + docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; + + else + + echo "[DEBUG] building image"; + + docker build . \ + --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ + --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ + --label org.opencontainers.image.source="$CI_PROJECT_URL" \ + --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ + --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ + --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ + --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ + --file $DOCKER_DOCKERFILE \ + --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; + + docker push $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; + + fi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: $CI_COMMIT_TAG + when: on_success + - if: '$CI_COMMIT_BRANCH == "development"' + when: on_success + - if: '$CI_COMMIT_BRANCH != "master"' + when: always + - when: never + + +Docker Container: + extends: .build_docker_container + + diff --git a/Dockerfile b/Dockerfile index 3158013..23a19b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ -FROM debian:11.7 +FROM --platform=$TARGETPLATFORM debian:11.7 ARG DEBIAN_FRONTEND=noninteractive +RUN ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache + +RUN /sbin/ldconfig && ls -la /var/cache/ldconfig + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update && apt-get install -y \ @@ -18,14 +22,17 @@ RUN export DEBIAN_FRONTEND=noninteractive \ RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ + add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" && \ apt-get update && apt-get install -y \ docker-buildx-plugin \ docker-ce-cli \ - binfmt-support=2.2.1-1+deb11u1 + #qemu-user + binfmt-support=2.2.1-1+deb11u1 \ + qemu-user-static=1:7.2+dfsg-7~bpo11+1 -# Write version file -RUN printf "$(docker --version | perl -pe 's/^.*\s(\d+\.\d+\.\d+.*),.*$/$1/')_$(docker buildx version | perl -pe 's/^.*v?(\d+\.\d+\.\d+).*$/$1/')" > /version && \ - cat /version +# # Write version file +# RUN printf "$(docker --version | perl -pe 's/^.*\s(\d+\.\d+\.\d+.*),.*$/$1/')_$(docker buildx version | perl -pe 's/^.*v?(\d+\.\d+\.\d+).*$/$1/')" > /version && \ +# cat /version -RUN echo "[DEBUG] why arm64 reports no docker 'which docker'=[$(which docker)]" \ No newline at end of file +# RUN echo "[DEBUG] why arm64 reports no docker 'which docker'=[$(which docker)]" \ No newline at end of file From 692457da01e5efa149ddbe16a3415880e3b60beb Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 May 2023 01:55:44 +0930 Subject: [PATCH 5/8] ci(gitlab-ci): update to current HEAD !4 --- .gitlab-ci.yml | 246 +++++++++++++++++++-------------------- Dockerfile => dockerfile | 0 gitlab-ci | 2 +- 3 files changed, 124 insertions(+), 124 deletions(-) rename Dockerfile => dockerfile (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0d8ab87..b88b577 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ include: ref: development file: - .gitlab-ci_common.yaml - - type/docker-image.gitlab-ci.yaml + - template/docker-image.gitlab-ci.yaml variables: @@ -32,153 +32,153 @@ variables: -.build_docker_container: - stage: build - image: nofusscomputing/docker-buildx-qemu:dev - services: - - name: docker:23-dind - entrypoint: ["env", "-u", "DOCKER_HOST"] - command: ["dockerd-entrypoint.sh"] - variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - DOCKER_DOCKERFILE: Dockerfile - # See https://github.com/docker-library/docker/pull/166 - DOCKER_TLS_CERTDIR: "" - before_script: - - if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi - - echo "[DEBUG] ROOT_DIR[$ROOT_DIR]" +# .build_docker_container: +# stage: build +# image: nofusscomputing/docker-buildx-qemu:dev +# services: +# - name: docker:23-dind +# entrypoint: ["env", "-u", "DOCKER_HOST"] +# command: ["dockerd-entrypoint.sh"] +# variables: +# DOCKER_HOST: tcp://docker:2375/ +# DOCKER_DRIVER: overlay2 +# DOCKER_DOCKERFILE: Dockerfile +# # See https://github.com/docker-library/docker/pull/166 +# DOCKER_TLS_CERTDIR: "" +# before_script: +# - if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi +# - echo "[DEBUG] ROOT_DIR[$ROOT_DIR]" - - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +# - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - docker info - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - #- pip3 install -r gitlab-ci/gitlab_release/requirements.txt - - pip3 install setuptools wheel - - pip install -r $ROOT_DIR/conventional_commits/requirements.txt - - pip3 install gitlab-ci/gitlab_release/python-module/cz_nfc/. +# - docker info +# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY +# #- pip3 install -r gitlab-ci/gitlab_release/requirements.txt +# - pip3 install setuptools wheel +# - pip install -r $ROOT_DIR/conventional_commits/requirements.txt +# - pip3 install gitlab-ci/gitlab_release/python-module/cz_nfc/. - # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 - - update-binfmts --display - - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use - - docker buildx create --driver=docker-container --use - - docker buildx inspect --bootstrap - # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache - # - /sbin/ldconfig && ls -la /var/cache/ldconfig - # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" - # - apt update - #- apt list --installed +# # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 +# - update-binfmts --display +# - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel +# #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use +# - docker buildx create --driver=docker-container --use +# - docker buildx inspect --bootstrap +# # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache +# # - /sbin/ldconfig && ls -la /var/cache/ldconfig +# # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" +# # - apt update +# #- apt list --installed - #- apt remove -y qemu-user-static - #- apt list --installed +# #- apt remove -y qemu-user-static +# #- apt list --installed - # - apt remove -y qemu-user-static - # - rm -f /var/cache/ldconfig/aux-cache - # - /sbin/ldconfig - # #- cp $(which qemu-aarch64-static) /usr/bin/qemu-aarch64 does nothing - # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 - # - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use +# # - apt remove -y qemu-user-static +# # - rm -f /var/cache/ldconfig/aux-cache +# # - /sbin/ldconfig +# # #- cp $(which qemu-aarch64-static) /usr/bin/qemu-aarch64 does nothing +# # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 +# # - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel +# #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use - # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache - # - /sbin/ldconfig && ls -la /var/cache/ldconfig - # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" - # - apt update - # - apt list --installed - # - apt install -y qemu-user-static=1:7.2+dfsg-7~bpo11+1 - # - apt remove -y qemu-user-static +# # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache +# # - /sbin/ldconfig && ls -la /var/cache/ldconfig +# # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" +# # - apt update +# # - apt list --installed +# # - apt install -y qemu-user-static=1:7.2+dfsg-7~bpo11+1 +# # - apt remove -y qemu-user-static - # - update-binfmts --display - # - apt list --installed - # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh - # - chmod +x /qemu-binfmt-conf.sh - # - mkdir -p /tester - # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin - # - update-binfmts --importdir=/tester --import - # - update-binfmts --enable - #- update-binfmts --display - # - docker buildx create --driver=docker-container --use - # - docker buildx inspect --bootstrap - # - apt list --installed - # - apt remove -y qemu-user-static - # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh - # - chmod +x /qemu-binfmt-conf.sh - # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" - # - apt update - # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 - # - mkdir -p /tester - # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin - # - update-binfmts --importdir=/tester --import - # - update-binfmts --enable - # - update-binfmts --display +# # - update-binfmts --display +# # - apt list --installed +# # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh +# # - chmod +x /qemu-binfmt-conf.sh +# # - mkdir -p /tester +# # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin +# # - update-binfmts --importdir=/tester --import +# # - update-binfmts --enable +# #- update-binfmts --display +# # - docker buildx create --driver=docker-container --use +# # - docker buildx inspect --bootstrap +# # - apt list --installed +# # - apt remove -y qemu-user-static +# # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh +# # - chmod +x /qemu-binfmt-conf.sh +# # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" +# # - apt update +# # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 +# # - mkdir -p /tester +# # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin +# # - update-binfmts --importdir=/tester --import +# # - update-binfmts --enable +# # - update-binfmts --display - #- update-binfmts --enable +# #- update-binfmts --enable - # --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ - # --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ - script: - #- update-binfmts --enable - - update-binfmts --display - - | +# # --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ +# # --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ +# script: +# #- update-binfmts --enable +# - update-binfmts --display +# - | - if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then +# if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then - echo "[DEBUG] building multiarch/specified arch image"; +# echo "[DEBUG] building multiarch/specified arch image"; - docker buildx build --platform=$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS . \ - --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ - --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ - --label org.opencontainers.image.source="$CI_PROJECT_URL" \ - --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ - --push \ - --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ - --file $DOCKER_DOCKERFILE \ - --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; +# docker buildx build --platform=$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS . \ +# --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ +# --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ +# --label org.opencontainers.image.source="$CI_PROJECT_URL" \ +# --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ +# --push \ +# --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ +# --file $DOCKER_DOCKERFILE \ +# --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; +# docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - # during docker multi platform build there are >=3 additional unknown images added to gitlab container registry. cleanup +# # during docker multi platform build there are >=3 additional unknown images added to gitlab container registry. cleanup - DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}{{ if ne (print .Platform) \"&{unknown unknown [] }\" }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }}{{end}} {{end}}"); +# DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}{{ if ne (print .Platform) \"&{unknown unknown [] }\" }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }}{{end}} {{end}}"); - docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; +# docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; +# docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - else +# else - echo "[DEBUG] building image"; +# echo "[DEBUG] building image"; - docker build . \ - --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ - --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ - --label org.opencontainers.image.source="$CI_PROJECT_URL" \ - --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ - --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ - --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ - --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ - --file $DOCKER_DOCKERFILE \ - --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; +# docker build . \ +# --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ +# --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ +# --label org.opencontainers.image.source="$CI_PROJECT_URL" \ +# --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ +# --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ +# --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ +# --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ +# --file $DOCKER_DOCKERFILE \ +# --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - docker push $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; +# docker push $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - fi - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - if: $CI_COMMIT_TAG - when: on_success - - if: '$CI_COMMIT_BRANCH == "development"' - when: on_success - - if: '$CI_COMMIT_BRANCH != "master"' - when: always - - when: never +# fi +# rules: +# - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' +# when: never +# - if: $CI_COMMIT_TAG +# when: on_success +# - if: '$CI_COMMIT_BRANCH == "development"' +# when: on_success +# - if: '$CI_COMMIT_BRANCH != "master"' +# when: always +# - when: never -Docker Container: - extends: .build_docker_container +# Docker Container: +# extends: .build_docker_container diff --git a/Dockerfile b/dockerfile similarity index 100% rename from Dockerfile rename to dockerfile diff --git a/gitlab-ci b/gitlab-ci index 18a2808..588956b 160000 --- a/gitlab-ci +++ b/gitlab-ci @@ -1 +1 @@ -Subproject commit 18a280878799fe077efa0ed5b11bceedd53eb5c8 +Subproject commit 588956b27ec8973bf8a0ce39566f1ec07a0c2f6b From 5f80d34f4e10b6fbf18e47d118da8fb5f08166be Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 May 2023 02:12:01 +0930 Subject: [PATCH 6/8] chore: cleanup !4 --- .gitlab-ci.yml | 156 +------------------------------------------------ dockerfile | 14 +---- 2 files changed, 2 insertions(+), 168 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b88b577..17da79b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,8 +17,7 @@ variables: #JOB_STOP_GIT_PUSH_MIRROR: 'disable for testing' #JOB_STOP_GITLAB_RELEASE: 'disable for testing' - #DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/arm/v7" - DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/arm64,linux/amd64,linux/arm/v7" + DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/arm/v7" # Package docker-ce-cli is not available for: # - linux/arm/v6 # - linux/386 @@ -29,156 +28,3 @@ variables: - - - -# .build_docker_container: -# stage: build -# image: nofusscomputing/docker-buildx-qemu:dev -# services: -# - name: docker:23-dind -# entrypoint: ["env", "-u", "DOCKER_HOST"] -# command: ["dockerd-entrypoint.sh"] -# variables: -# DOCKER_HOST: tcp://docker:2375/ -# DOCKER_DRIVER: overlay2 -# DOCKER_DOCKERFILE: Dockerfile -# # See https://github.com/docker-library/docker/pull/166 -# DOCKER_TLS_CERTDIR: "" -# before_script: -# - if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi -# - echo "[DEBUG] ROOT_DIR[$ROOT_DIR]" - -# - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - -# - docker info -# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY -# #- pip3 install -r gitlab-ci/gitlab_release/requirements.txt -# - pip3 install setuptools wheel -# - pip install -r $ROOT_DIR/conventional_commits/requirements.txt -# - pip3 install gitlab-ci/gitlab_release/python-module/cz_nfc/. - - -# # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 -# - update-binfmts --display -# - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel -# #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use -# - docker buildx create --driver=docker-container --use -# - docker buildx inspect --bootstrap -# # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache -# # - /sbin/ldconfig && ls -la /var/cache/ldconfig -# # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" -# # - apt update -# #- apt list --installed - -# #- apt remove -y qemu-user-static -# #- apt list --installed - -# # - apt remove -y qemu-user-static -# # - rm -f /var/cache/ldconfig/aux-cache -# # - /sbin/ldconfig -# # #- cp $(which qemu-aarch64-static) /usr/bin/qemu-aarch64 does nothing -# # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 -# # - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel -# #- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use - -# # - ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache -# # - /sbin/ldconfig && ls -la /var/cache/ldconfig -# # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" -# # - apt update -# # - apt list --installed -# # - apt install -y qemu-user-static=1:7.2+dfsg-7~bpo11+1 -# # - apt remove -y qemu-user-static - -# # - update-binfmts --display -# # - apt list --installed -# # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh -# # - chmod +x /qemu-binfmt-conf.sh -# # - mkdir -p /tester -# # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin -# # - update-binfmts --importdir=/tester --import -# # - update-binfmts --enable -# #- update-binfmts --display -# # - docker buildx create --driver=docker-container --use -# # - docker buildx inspect --bootstrap -# # - apt list --installed -# # - apt remove -y qemu-user-static -# # - curl https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh -o /qemu-binfmt-conf.sh -# # - chmod +x /qemu-binfmt-conf.sh -# # - add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" -# # - apt update -# # - apt install -y qemu-user=1:7.2+dfsg-7~bpo11+1 -# # - mkdir -p /tester -# # - /qemu-binfmt-conf.sh --exportdir /tester --debian --qemu-path /usr/bin -# # - update-binfmts --importdir=/tester --import -# # - update-binfmts --enable -# # - update-binfmts --display - -# #- update-binfmts --enable - - -# # --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ -# # --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ -# script: -# #- update-binfmts --enable -# - update-binfmts --display -# - | - -# if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then - -# echo "[DEBUG] building multiarch/specified arch image"; - -# docker buildx build --platform=$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS . \ -# --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ -# --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ -# --label org.opencontainers.image.source="$CI_PROJECT_URL" \ -# --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ -# --push \ -# --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ -# --file $DOCKER_DOCKERFILE \ -# --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - -# docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - -# # during docker multi platform build there are >=3 additional unknown images added to gitlab container registry. cleanup - -# DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}{{ if ne (print .Platform) \"&{unknown unknown [] }\" }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }}{{end}} {{end}}"); - -# docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - -# docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - -# else - -# echo "[DEBUG] building image"; - -# docker build . \ -# --label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \ -# --label org.opencontainers.image.documentation="$CI_PROJECT_URL" \ -# --label org.opencontainers.image.source="$CI_PROJECT_URL" \ -# --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \ -# --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \ -# --label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ -# --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \ -# --file $DOCKER_DOCKERFILE \ -# --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - -# docker push $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG; - -# fi -# rules: -# - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' -# when: never -# - if: $CI_COMMIT_TAG -# when: on_success -# - if: '$CI_COMMIT_BRANCH == "development"' -# when: on_success -# - if: '$CI_COMMIT_BRANCH != "master"' -# when: always -# - when: never - - -# Docker Container: -# extends: .build_docker_container - - diff --git a/dockerfile b/dockerfile index 23a19b4..3f56515 100644 --- a/dockerfile +++ b/dockerfile @@ -3,13 +3,8 @@ FROM --platform=$TARGETPLATFORM debian:11.7 ARG DEBIAN_FRONTEND=noninteractive -RUN ls -la /var/cache/ldconfig && rm -f /var/cache/ldconfig/aux-cache -RUN /sbin/ldconfig && ls -la /var/cache/ldconfig - - -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt-get update && apt-get install -y \ +RUN apt-get update && apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ @@ -29,10 +24,3 @@ RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ #qemu-user binfmt-support=2.2.1-1+deb11u1 \ qemu-user-static=1:7.2+dfsg-7~bpo11+1 - - -# # Write version file -# RUN printf "$(docker --version | perl -pe 's/^.*\s(\d+\.\d+\.\d+.*),.*$/$1/')_$(docker buildx version | perl -pe 's/^.*v?(\d+\.\d+\.\d+).*$/$1/')" > /version && \ -# cat /version - -# RUN echo "[DEBUG] why arm64 reports no docker 'which docker'=[$(which docker)]" \ No newline at end of file From d352f0e899d5da43a23ebe25167718f947149cf4 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 May 2023 02:38:05 +0930 Subject: [PATCH 7/8] feat(build): use debian slim !4 --- dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dockerfile b/dockerfile index 3f56515..3302c17 100644 --- a/dockerfile +++ b/dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$TARGETPLATFORM debian:11.7 +FROM --platform=$TARGETPLATFORM debian:11.7-slim ARG DEBIAN_FRONTEND=noninteractive @@ -21,6 +21,5 @@ RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ apt-get update && apt-get install -y \ docker-buildx-plugin \ docker-ce-cli \ - #qemu-user binfmt-support=2.2.1-1+deb11u1 \ qemu-user-static=1:7.2+dfsg-7~bpo11+1 From e49f78f712ea84f7d411e8916b1a7f8b87b26e22 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 May 2023 13:32:33 +0930 Subject: [PATCH 8/8] docs(readme): added usage within gitlab-ci !4 --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 4dd474d..82f082d 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,23 @@ links: > This is a fork of https://gitlab.com/gdunstone/docker-buildx-qemu, which appears to be a fork of a fork. anyhow, updates are required. Credit to original and derivitive devs/contributors for getting it to the stage they had!! +This docker image enables building of multi-architecture docker builds. It's designed to run within a CI environment. + +To use this image within Gitlab CI/CD Pipelines the following as a minimum is required within your `gitlab-ci.yaml` file, specifically the `before_script` section of your `docker buildx build` job: + +``` yaml +before_script: + # see: https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/1861 + # on why this `docker run` is required. without it multiarch support doesnt work. + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - update-binfmts --display + - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel + - docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use + - docker buildx inspect --bootstrap +``` + +When the above is added to the `before_script` section of the docker container build job, Gitlab CI has been initialized for multi-architecture builds. + ## Contributing All contributions for this project must conducted from [Gitlab](https://gitlab.com/nofusscomputing/projects/docker-buildx-qemu).