From 2b65dcbdeda1b29517735a3d87fcd2ba1014acaa Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 12 May 2023 10:42:56 +0930 Subject: [PATCH 01/17] docs(readme): updated to current format !1 --- README.md | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ readme.md | 60 -------------------------- 2 files changed, 124 insertions(+), 60 deletions(-) create mode 100644 README.md delete mode 100644 readme.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b5baad5 --- /dev/null +++ b/README.md @@ -0,0 +1,124 @@ +
+ + +# No Fuss Computing - Docker Buildx with QEMU + +
+ +![Project Status - Active](https://img.shields.io/badge/Project%20Status-Active-green?logo=gitlab&style=plastic) + +
+ +![Gitlab forks count](https://img.shields.io/badge/dynamic/json?label=Forks&query=%24.forks_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F45926238%2F&color=ff782e&logo=gitlab&style=plastic) ![Gitlab stars](https://img.shields.io/badge/dynamic/json?label=Stars&query=%24.star_count&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F45926238%2F&color=ff782e&logo=gitlab&style=plastic) [![Open Issues](https://img.shields.io/badge/dynamic/json?color=ff782e&logo=gitlab&style=plastic&label=Open%20Issues&query=%24.statistics.counts.opened&url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F45926238%2Fissues_statistics)](https://gitlab.com/nofusscomputing/projects/docker-buildx-qemu/-/issues) + + + +![GitHub forks](https://img.shields.io/github/forks/NofussComputing/docker-buildx-qemu?logo=github&style=plastic&color=000000&labell=Forks) ![GitHub stars](https://img.shields.io/github/stars/NofussComputing/docker-buildx-qemu?color=000000&logo=github&style=plastic) ![Github Watchers](https://img.shields.io/github/watchers/NofussComputing/docker-buildx-qemu?color=000000&label=Watchers&logo=github&style=plastic) +
+ +This project is hosted on [gitlab](https://gitlab.com/nofusscomputing/projects/docker-buildx-qemu) and has a read-only copy hosted on [Github](https://github.com/NofussComputing/docker-buildx-qemu). + +---- + +**Stable Branch** + +![Gitlab build status - stable](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%3Dmaster&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%2Fmaster%2F.cz.yaml) + +---- + +**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) + +---- +
+ +
+ +links: + +- [Issues](https://gitlab.com/nofusscomputing/projects/docker-buildx-qemu/-/issues) + +- [Merge Requests (Pull Requests)](https://gitlab.com/nofusscomputing/projects/docker-buildx-qemu/-/merge_requests) + + + +> 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!! + + +## Contributing +All contributions for this project must conducted from [Gitlab](https://gitlab.com/nofusscomputing/projects/docker-buildx-qemu). + +For further details on contributing please refer to the [contribution guide](CONTRIBUTING.md). + + +## Other + +This repo is release under this [license](LICENSE) + +
+Original README.md + +# docker-buildx-qemu + +> this is a fork of https://gitlab.com/ericvh/docker-buildx-qemu +> it has been modified to not depend on a gitlab-ci template repository. + + +This Debian-based image allows you to easily build cross-platform images. +It's been tested with GitLab CI on gitlab.com, but it should work anywhere that docker-in-docker already works, and with a binfmt_misc enabled kernel. + +## Example Usage + +This GitLab example should give you an idea of how to use the image. + +Dockerfile +```dockerfile +FROM alpine + +RUN echo "Hello, my CPU architecture is $(uname -m)" +``` + +.gitlab-ci.yml +```yaml +variables: + CI_BUILD_ARCHS: "linux/arm/v7,linux/arm64,linux/amd64" + CI_BUILD_IMAGE: "registry.gitlab.com/ericvh/docker-buildx-qemu" + +build: + image: $CI_BUILD_IMAGE + stage: build + services: + - name: docker:dind + entrypoint: ["env", "-u", "DOCKER_HOST"] + command: ["dockerd-entrypoint.sh"] + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + # See https://github.com/docker-library/docker/pull/166 + DOCKER_TLS_CERTDIR: "" + retry: 2 + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + # Use docker-container driver to allow useful features (push/multi-platform) + - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel + - docker buildx create --driver docker-container --use + - docker buildx inspect --bootstrap + script: + - docker buildx ls + - docker buildx build --platform $CI_BUILD_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push . +``` + +And the (partial) output: +``` +#6 [linux/amd64 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)" +#6 0.120 Hello, my CPU architecture is x86_64 +#6 DONE 0.3s + +#8 [linux/arm/v7 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)" +#8 0.233 Hello, my CPU architecture is armv7l +#8 DONE 0.2s +``` + + +
\ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index 90586a1..0000000 --- a/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# docker-buildx-qemu - -> this is a fork of https://gitlab.com/ericvh/docker-buildx-qemu -> it has been modified to not depend on a gitlab-ci template repository. - - -This Debian-based image allows you to easily build cross-platform images. -It's been tested with GitLab CI on gitlab.com, but it should work anywhere that docker-in-docker already works, and with a binfmt_misc enabled kernel. - -## Example Usage - -This GitLab example should give you an idea of how to use the image. - -Dockerfile -```dockerfile -FROM alpine - -RUN echo "Hello, my CPU architecture is $(uname -m)" -``` - -.gitlab-ci.yml -```yaml -variables: - CI_BUILD_ARCHS: "linux/arm/v7,linux/arm64,linux/amd64" - CI_BUILD_IMAGE: "registry.gitlab.com/ericvh/docker-buildx-qemu" - -build: - image: $CI_BUILD_IMAGE - stage: build - services: - - name: docker:dind - entrypoint: ["env", "-u", "DOCKER_HOST"] - command: ["dockerd-entrypoint.sh"] - variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - # See https://github.com/docker-library/docker/pull/166 - DOCKER_TLS_CERTDIR: "" - retry: 2 - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - # Use docker-container driver to allow useful features (push/multi-platform) - - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - - docker buildx create --driver docker-container --use - - docker buildx inspect --bootstrap - script: - - docker buildx ls - - docker buildx build --platform $CI_BUILD_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push . -``` - -And the (partial) output: -``` -#6 [linux/amd64 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)" -#6 0.120 Hello, my CPU architecture is x86_64 -#6 DONE 0.3s - -#8 [linux/arm/v7 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)" -#8 0.233 Hello, my CPU architecture is armv7l -#8 DONE 0.2s -``` -- 2.49.0 From 00ec4016891b0cd87c46cf1cf879bd6582de666e Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 12 May 2023 10:43:27 +0930 Subject: [PATCH 02/17] chore: remove additional gitlab-ci file !1 --- original-gitlab-ci.yml | 46 ------------------------------------------ 1 file changed, 46 deletions(-) delete mode 100644 original-gitlab-ci.yml diff --git a/original-gitlab-ci.yml b/original-gitlab-ci.yml deleted file mode 100644 index 240c701..0000000 --- a/original-gitlab-ci.yml +++ /dev/null @@ -1,46 +0,0 @@ -image: jonoh/docker-buildx-qemu - -variables: - DOCKER_HOST: tcp://docker:2375/ - PLATFORM: local - DOCKER_IMAGE_TAG: latest - DOCKER_PREBUILD_CMD: echo - -services: - - docker:dind - -.docker_before_script: &docker_before_script - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - docker pull "$CI_REGISTRY_IMAGE" || true - - '[[ "$PLATFORM" != "local" ]] && update-binfmts --enable' - # Use docker-container driver to allow useful features (push/multi-platform) - - docker buildx create --driver docker-container --use - - docker buildx inspect --bootstrap - -build: - stage: build - before_script: *docker_before_script - script: - - $DOCKER_PREBUILD_CMD - - docker buildx build - --pull - --cache-from "$CI_REGISTRY_IMAGE" - --platform "$PLATFORM" - -t "$CI_REGISTRY_IMAGE:$DOCKER_IMAGE_TAG" - --push $EXTRA_BUILD_ARGS . - only: - - master - -build-unstable: - stage: build - before_script: *docker_before_script - script: - - $DOCKER_PREBUILD_CMD - - docker buildx build - --pull - --cache-from "$CI_REGISTRY_IMAGE" - --platform "$PLATFORM" - -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" - --push $EXTRA_BUILD_ARGS . - except: - - master -- 2.49.0 From 7f1ce78610be09b658a05d598fb97d500b0c7483 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 12 May 2023 10:43:41 +0930 Subject: [PATCH 03/17] chore: add licence !1 --- LICENSE | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8dc76e0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,10 @@ +MIT License + +Copyright + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + -- 2.49.0 From ef1c9501f51c9e4d969e66e9d488181dcc36c76b Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 12 May 2023 10:44:33 +0930 Subject: [PATCH 04/17] ci(build): don't retry build dont auto retry as a failure should be investigated !1 --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 745488d..97e9677 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,6 @@ DOCKER_DRIVER: overlay2 # See https://github.com/docker-library/docker/pull/166 DOCKER_TLS_CERTDIR: "" - retry: 2 before_script: - | if [[ -z "$CI_COMMIT_TAG" ]]; then -- 2.49.0 From 72a0c3f9d7f0cbdb4da49437242eba7d0d3e339f Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:05:43 +0930 Subject: [PATCH 05/17] docs: clean readme !1 --- README.md | 67 ------------------------------------------------------- 1 file changed, 67 deletions(-) diff --git a/README.md b/README.md index b5baad5..9bc153a 100644 --- a/README.md +++ b/README.md @@ -55,70 +55,3 @@ For further details on contributing please refer to the [contribution guide](CON ## Other This repo is release under this [license](LICENSE) - -
-Original README.md - -# docker-buildx-qemu - -> this is a fork of https://gitlab.com/ericvh/docker-buildx-qemu -> it has been modified to not depend on a gitlab-ci template repository. - - -This Debian-based image allows you to easily build cross-platform images. -It's been tested with GitLab CI on gitlab.com, but it should work anywhere that docker-in-docker already works, and with a binfmt_misc enabled kernel. - -## Example Usage - -This GitLab example should give you an idea of how to use the image. - -Dockerfile -```dockerfile -FROM alpine - -RUN echo "Hello, my CPU architecture is $(uname -m)" -``` - -.gitlab-ci.yml -```yaml -variables: - CI_BUILD_ARCHS: "linux/arm/v7,linux/arm64,linux/amd64" - CI_BUILD_IMAGE: "registry.gitlab.com/ericvh/docker-buildx-qemu" - -build: - image: $CI_BUILD_IMAGE - stage: build - services: - - name: docker:dind - entrypoint: ["env", "-u", "DOCKER_HOST"] - command: ["dockerd-entrypoint.sh"] - variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - # See https://github.com/docker-library/docker/pull/166 - DOCKER_TLS_CERTDIR: "" - retry: 2 - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - # Use docker-container driver to allow useful features (push/multi-platform) - - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - - docker buildx create --driver docker-container --use - - docker buildx inspect --bootstrap - script: - - docker buildx ls - - docker buildx build --platform $CI_BUILD_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push . -``` - -And the (partial) output: -``` -#6 [linux/amd64 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)" -#6 0.120 Hello, my CPU architecture is x86_64 -#6 DONE 0.3s - -#8 [linux/arm/v7 2/2] RUN echo "Hello, my CPU architecture is $(uname -m)" -#8 0.233 Hello, my CPU architecture is armv7l -#8 DONE 0.2s -``` - - -
\ No newline at end of file -- 2.49.0 From d86b5b35df494dfbc332b41035d2acf40d6fe1b4 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:06:33 +0930 Subject: [PATCH 06/17] feat(build): add commitizen for versioning !1 --- .cz.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .cz.yaml diff --git a/.cz.yaml b/.cz.yaml new file mode 100644 index 0000000..62b2ada --- /dev/null +++ b/.cz.yaml @@ -0,0 +1,7 @@ +commitizen: + bump_message: "build(version): bump version $current_version \u2192 $new_version" + changelog_incremental: false + name: cz_conventional_commits + tag_format: $major.$minor.$patch$prerelease + update_changelog_on_bump: true + version: 0.0.1 -- 2.49.0 From 03c98a8c814e0b26fb67949b96374fc6a35944a9 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:07:26 +0930 Subject: [PATCH 07/17] feat(ci): use nfc gitlab-ci project !1 --- .gitmodules | 4 ++++ gitlab-ci | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 gitlab-ci diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7b8f57b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "gitlab-ci"] + path = gitlab-ci + url = https://gitlab.com/nofusscomputing/projects/gitlab-ci.git + branch = restructure diff --git a/gitlab-ci b/gitlab-ci new file mode 160000 index 0000000..640149b --- /dev/null +++ b/gitlab-ci @@ -0,0 +1 @@ +Subproject commit 640149bc6bfc0850debfff6bdff7251f014e7aaf -- 2.49.0 From 92c1cefb9550ec526d3149edb33d43e25dcdfd75 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:09:17 +0930 Subject: [PATCH 08/17] feat(image): add python3 and pip !1 --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3f39a9..17e95a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,9 @@ RUN apt-get update && apt-get install -y \ ca-certificates \ curl \ gnupg2 \ - software-properties-common && \ - curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ + software-properties-common \ + python3 \ + python3-pip || true add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ apt-get update && apt-get install -y \ docker-ce-cli \ -- 2.49.0 From 069a47808a44b0cd1b23e2b526e28aca688406b0 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:10:22 +0930 Subject: [PATCH 09/17] feat(software): install buildx plugin from docker repo !1 --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17e95a7..df7819a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,18 +9,17 @@ RUN apt-get update && apt-get install -y \ software-properties-common \ python3 \ python3-pip || true + + +# 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 + qemu-user-static || true -# Install buildx plugin -RUN mkdir -p ~/.docker/cli-plugins && \ - ARCH=`dpkg --print-architecture` && echo Running on $ARCH && curl -s https://api.github.com/repos/docker/buildx/releases/latest | \ - grep "browser_download_url.*linux-$ARCH" | cut -d : -f 2,3 | tr -d \" | \ - xargs curl -L -o ~/.docker/cli-plugins/docker-buildx && \ - chmod a+x ~/.docker/cli-plugins/docker-buildx # 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 && \ -- 2.49.0 From 8af1cee94657544b07f14103b257e04b57f0b781 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:11:09 +0930 Subject: [PATCH 10/17] feat(software): install git !1 --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index df7819a..43db527 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ + git \ gnupg2 \ software-properties-common \ python3 \ -- 2.49.0 From b24291165772b415800a68dd40e048ce666af0be Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:12:14 +0930 Subject: [PATCH 11/17] fix: set apt to be noninteractive !1 --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 43db527..95abc71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM debian -# Install Docker and qemu -# TODO Use docker stable once it properly supports buildx -RUN apt-get update && apt-get install -y \ + +RUN export DEBIAN_FRONTEND=noninteractive \ + && apt-get update && apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ -- 2.49.0 From 80a440f855757c3d3e2b058fbd39fe2fc4484fb3 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:13:10 +0930 Subject: [PATCH 12/17] fix: libc issues workaround added !1 --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index 95abc71..4be7b83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,13 @@ FROM debian + + +RUN export DEBIAN_FRONTEND=noninteractive \ + && apt-get update && apt --fix-broken install \ + && apt install -y libc-bin locales-all + + + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update && apt-get install -y \ apt-transport-https \ @@ -25,3 +33,5 @@ RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ # 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 -- 2.49.0 From 76b3b6d6c11672b579106e5911fa67b8fcdb3a7e Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:13:42 +0930 Subject: [PATCH 13/17] ci: completely use gitlab-ci project for pipeline !1 --- .gitlab-ci.yml | 132 ++++++------------------------------------------- 1 file changed, 15 insertions(+), 117 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97e9677..ab36a98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,123 +1,21 @@ -# available variables, do not uncomment all at once. -# variables: -# CI_BUILDX_ARCHS: "linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7" -# CI_BUILD_ARM: true -# CI_BUILD_ARM64: true -# CI_AMD64_DISABLED: true -.build: - image: docker:dind - stage: build - services: - - name: docker:dind - entrypoint: ["env", "-u", "DOCKER_HOST"] - command: ["dockerd-entrypoint.sh"] - variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - # See https://github.com/docker-library/docker/pull/166 - DOCKER_TLS_CERTDIR: "" - before_script: - - | - if [[ -z "$CI_COMMIT_TAG" ]]; then - export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG} - export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA} - else - export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE} - export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG} - fi - - echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY +include: + - project: nofusscomputing/projects/gitlab-ci + ref: restructure + file: + - .gitlab-ci_common.yaml + - type/docker-image.gitlab-ci.yaml -# these images depend on this repos image -# it must exist for for the arch that the gitlab-runner has. -build:buildx-master: - extends: .build - # set the image because we are using buildx here. - image: $CI_REGISTRY_IMAGE:latest - only: - refs: - - master - variables: - - $CI_BUILDX_ARCHS - script: - # Use docker-container driver to allow useful features (push/multi-platform) - - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - - docker buildx create --driver docker-container --use - - docker buildx inspect --bootstrap - - docker buildx ls - - docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push . -build:buildx: - extends: .build - # set the image because we are using buildx here. - image: $CI_REGISTRY_IMAGE:latest - only: - variables: - - $CI_BUILDX_ARCHS - except: - refs: - - master - script: - - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - - docker buildx create --driver docker-container --use - - docker buildx inspect --bootstrap - - docker buildx ls - - docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" --push . +variables: + MY_PROJECT_ID: "45926238" -# disable build:armv7 for now since it seems to have an issue with dind -.build:arm: - extends: .build - only: - variables: - - $CI_BUILD_ARM - except: - variables: - - $CI_BUILDX_ARCHS - tags: - - arm - script: - - docker build -t "$CI_APPLICATION_REPOSITORY/arm:$CI_APPLICATION_TAG" . - - docker push "$CI_APPLICATION_REPOSITORY/arm:$CI_APPLICATION_TAG" + JOB_STOP_CONVENTIONAL_COMMITS: 'disable for testing' + JOB_STOP_GIT_PUSH_MIRROR: 'disable for testing' + JOB_STOP_GITLAB_RELEASE: 'disable for testing' -build:arm64: - extends: .build - only: - variables: - - $CI_BUILD_ARM64 - except: - variables: - - $CI_BUILDX_ARCHS - tags: - - arm64 - - script: - - docker build -t "$CI_APPLICATION_REPOSITORY/arm64:$CI_APPLICATION_TAG" . - - docker push "$CI_APPLICATION_REPOSITORY/arm64:$CI_APPLICATION_TAG" - -# builds this by default -build:amd64: - extends: .build - except: - variables: - - $CI_AMD64_DISABLED - - $CI_BUILDX_ARCHS - script: - - docker build -t "$CI_APPLICATION_REPOSITORY/amd64:$CI_APPLICATION_TAG" . - - docker push "$CI_APPLICATION_REPOSITORY/amd64:$CI_APPLICATION_TAG" - -build:manifest: - extends: .build - stage: deploy - except: - variables: - - $CI_BUILDX_ARCHS - script: - - echo "Checking amd86 build..." && [[ -z $CI_AMD64_DISABLED ]] && echo "found" && export CI_MANIFEST_LIST="$CI_APPLICATION_REPOSITORY/amd64:$CI_APPLICATION_TAG" - - echo "Checking arm build..." && [[ $CI_BUILD_ARM ]] && echo "found" && export CI_MANIFEST_LIST="$CI_MANIFEST_LIST $CI_APPLICATION_REPOSITORY/arm:$CI_APPLICATION_TAG" - - echo "Checking arm64 build..." && [[ $CI_BUILD_ARM64 ]] && echo "found" && export CI_MANIFEST_LIST="$CI_MANIFEST_LIST $CI_APPLICATION_REPOSITORY/arm64:$CI_APPLICATION_TAG" - - export DOCKER_CLI_EXPERIMENTAL=enabled - - echo $CI_MANIFEST_LIST - - docker manifest create $CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG $CI_MANIFEST_LIST && docker manifest push $CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG - - docker manifest create $CI_APPLICATION_REPOSITORY:latest $CI_MANIFEST_LIST && docker manifest push $CI_APPLICATION_REPOSITORY:latest - - echo "Checking master" && [[ $CI_COMMIT_REF_NAME == "master" ]] && docker manifest create $CI_REGISTRY_IMAGE:latest $CI_MANIFEST_LIST && docker manifest push $CI_REGISTRY_IMAGE:latest + 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_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 -- 2.49.0 From be82a6cc90508ff628768657024c53cac9745bb4 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:26:15 +0930 Subject: [PATCH 14/17] ci: add sync to github !1 --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab36a98..768c96f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,8 @@ include: variables: MY_PROJECT_ID: "45926238" + GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/docker-buildx-qemu.git" + JOB_STOP_CONVENTIONAL_COMMITS: 'disable for testing' JOB_STOP_GIT_PUSH_MIRROR: 'disable for testing' JOB_STOP_GITLAB_RELEASE: 'disable for testing' -- 2.49.0 From b229fd8eb9a06d7a09e6538777b7e27938ff2ac6 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 May 2023 15:32:14 +0930 Subject: [PATCH 15/17] ci: enable jobs validation and git mirror and release !1 --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 768c96f..2d772b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,9 +13,9 @@ variables: GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/docker-buildx-qemu.git" - JOB_STOP_CONVENTIONAL_COMMITS: 'disable for testing' - JOB_STOP_GIT_PUSH_MIRROR: 'disable for testing' - JOB_STOP_GITLAB_RELEASE: 'disable for testing' + #JOB_STOP_CONVENTIONAL_COMMITS: 'disable for testing' + #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_PUBLISH_NAME: $CI_PROJECT_NAME -- 2.49.0 From 9cabecb460144158133a68b074bfdb67c51814ec Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 14 May 2023 16:16:58 +0930 Subject: [PATCH 16/17] chore: update submodule to current dev !1 --- .gitlab-ci.yml | 2 +- .gitmodules | 2 +- gitlab-ci | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d772b0..2e30af7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ include: - project: nofusscomputing/projects/gitlab-ci - ref: restructure + ref: development file: - .gitlab-ci_common.yaml - type/docker-image.gitlab-ci.yaml diff --git a/.gitmodules b/.gitmodules index 7b8f57b..cc4d8a5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "gitlab-ci"] path = gitlab-ci url = https://gitlab.com/nofusscomputing/projects/gitlab-ci.git - branch = restructure + branch = development diff --git a/gitlab-ci b/gitlab-ci index 640149b..a073dd0 160000 --- a/gitlab-ci +++ b/gitlab-ci @@ -1 +1 @@ -Subproject commit 640149bc6bfc0850debfff6bdff7251f014e7aaf +Subproject commit a073dd0bad691992d0b8618ff0616175031a669a -- 2.49.0 From 45747fe6e0d54c3168cf90764952b756b21edf65 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 15 May 2023 10:57:11 +0930 Subject: [PATCH 17/17] ci: update to current gitlab-ci project dev head incorporates changes from nofusscomputing/projects/gitlab-ci!17 !1 nofusscomputing/projects/gitlab-ci!17 --- gitlab-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab-ci b/gitlab-ci index a073dd0..18a2808 160000 --- a/gitlab-ci +++ b/gitlab-ci @@ -1 +1 @@ -Subproject commit a073dd0bad691992d0b8618ff0616175031a669a +Subproject commit 18a280878799fe077efa0ed5b11bceedd53eb5c8 -- 2.49.0