From 7c74bb4c22dd52464a6aec8068d7375a371edbb9 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 16 Jan 2021 21:51:11 +0100 Subject: [PATCH] try to re-enable arm builds --- .drone.jsonnet | 2 + .drone.yml | 89 ++++++++++++++++++++++++++++++++++++++++- docker/Dockerfile.amd64 | 4 +- docker/Dockerfile.arm | 2 + docker/Dockerfile.arm64 | 4 +- 5 files changed, 98 insertions(+), 3 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 03f9d2b..8f177a3 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -306,6 +306,7 @@ local PipelineNotifications = { 'build-binaries', 'build-container-amd64', 'build-container-arm64', + 'build-container-arm32', ], trigger: { ref: ['refs/heads/main', 'refs/tags/**'], @@ -318,5 +319,6 @@ local PipelineNotifications = { PipelineBuildBinaries, PipelineBuildContainer(arch='amd64'), PipelineBuildContainer(arch='arm64'), + PipelineBuildContainer(arch='arm32'), PipelineNotifications, ] diff --git a/.drone.yml b/.drone.yml index 64aed9f..e9b19e4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -284,6 +284,92 @@ trigger: depends_on: - test +--- +kind: pipeline +name: build-container-arm32 + +platform: + os: linux + arch: arm32 + +steps: +- name: build + image: golang:1.15 + commands: + - "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}" + - go build -v -ldflags "-X main.version=$BUILD_VERSION" -a -tags netgo -o release/arm32/drone-docker-buildx ./cmd/drone-docker-buildx + +- name: dryrun + image: plugins/docker:19 + settings: + config: + from_secret: docker_config + dockerfile: docker/Dockerfile.arm32 + dry_run: true + password: + from_secret: docker_password + repo: thegeeklab/${DRONE_REPO_NAME} + username: + from_secret: docker_username + when: + ref: + - refs/pull/** + depends_on: + - build + +- name: publish-dockerhub + image: plugins/docker:19 + settings: + auto_tag: true + auto_tag_suffix: arm32 + config: + from_secret: docker_config + dockerfile: docker/Dockerfile.arm32 + password: + from_secret: docker_password + repo: thegeeklab/${DRONE_REPO_NAME} + username: + from_secret: docker_username + when: + ref: + - refs/heads/main + - refs/tags/** + depends_on: + - dryrun + +- name: publish-quay + image: plugins/docker:19 + settings: + auto_tag: true + auto_tag_suffix: arm32 + config: + from_secret: docker_config + dockerfile: docker/Dockerfile.arm32 + password: + from_secret: quay_password + registry: quay.io + repo: quay.io/thegeeklab/${DRONE_REPO_NAME} + username: + from_secret: quay_username + when: + ref: + - refs/heads/main + - refs/tags/** + depends_on: + - dryrun + +image_pull_secrets: +- docker_config + +trigger: + ref: + - refs/heads/main + - refs/tags/** + - refs/pull/** + +depends_on: +- test + --- kind: pipeline name: notifications @@ -378,9 +464,10 @@ depends_on: - build-binaries - build-container-amd64 - build-container-arm64 +- build-container-arm32 --- kind: signature -hmac: 5e6192104654e4d8a0eec27f2a39836ca303a7909fda72bc75d236106501231d +hmac: b37b207f06dbdefc004f152012da423ae9312aa0e617d4ecb37556bc7e4cb751 ... diff --git a/docker/Dockerfile.amd64 b/docker/Dockerfile.amd64 index e83d721..1d19d99 100644 --- a/docker/Dockerfile.amd64 +++ b/docker/Dockerfile.amd64 @@ -1,4 +1,4 @@ -FROM amd64/docker:20.10-dind@sha256:12521ff42db0d1e1d99f89c7dea6aa6e2d028c20cb42dad8285503735ddf678d +FROM amd64/docker:19.03-dind LABEL maintainer="Robert Kaussow " LABEL org.opencontainers.image.authors="Robert Kaussow " @@ -16,6 +16,8 @@ ENV DOCKER_HOST=unix:///var/run/docker.sock RUN apk --update add --virtual .build-deps curl && \ mkdir -p /usr/lib/docker/cli-plugins/ && \ curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" && \ + curl -SsL -o /var/lib/docker/default.json https://github.com/moby/moby/blob/19.03/profiles/seccomp/default.json && \ + chmod 600 /var/lib/docker/default.json && \ chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \ apk del .build-deps && \ rm -rf /var/cache/apk/* && \ diff --git a/docker/Dockerfile.arm b/docker/Dockerfile.arm index 5a6396f..4e4d371 100644 --- a/docker/Dockerfile.arm +++ b/docker/Dockerfile.arm @@ -16,6 +16,8 @@ ENV DOCKER_HOST=unix:///var/run/docker.sock RUN apk --update add --virtual .build-deps curl && \ mkdir -p /usr/lib/docker/cli-plugins/ && \ curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" && \ + curl -SsL -o /var/lib/docker/default.json https://github.com/moby/moby/blob/19.03/profiles/seccomp/default.json && \ + chmod 600 /var/lib/docker/default.json && \ chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \ apk del .build-deps && \ rm -rf /var/cache/apk/* && \ diff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64 index 317d2cd..dfc1cab 100644 --- a/docker/Dockerfile.arm64 +++ b/docker/Dockerfile.arm64 @@ -1,4 +1,4 @@ -FROM arm64v8/docker:20.10-dind@sha256:009bdea1b7cf4de7f5f7febf8cce1f322b92598927318c78cd2c012d8c0dc866 +FROM arm64v8/docker:19.03-dind LABEL maintainer="Robert Kaussow " LABEL org.opencontainers.image.authors="Robert Kaussow " @@ -16,6 +16,8 @@ ENV DOCKER_HOST=unix:///var/run/docker.sock RUN apk --update add --virtual .build-deps curl && \ mkdir -p /usr/lib/docker/cli-plugins/ && \ curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" && \ + curl -SsL -o /var/lib/docker/default.json https://github.com/moby/moby/blob/19.03/profiles/seccomp/default.json && \ + chmod 600 /var/lib/docker/default.json && \ chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \ apk del .build-deps && \ rm -rf /var/cache/apk/* && \