From dda3c4b6c3d04b209d1a84417856d1780b7e3926 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Sat, 13 Jul 2019 14:30:35 -0700 Subject: [PATCH] Enable multi-arch builds --- .drone.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 3 ++- manifest.tmpl | 25 +++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 manifest.tmpl diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..91e8b05 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,66 @@ +kind: pipeline +name: publish + +trigger: + event: + - push + - tag + refs: + - refs/heads/master + - refs/tags/v* + +steps: + - name: push image - arm + image: plugins/docker + settings: + repo: iamthefij/docker-socket-proxy + auto_tag: true + auto_tag_suffix: linux-arm + username: + from_secret: docker_username + password: + from_secret: docker_password + build_args: + - REPO=arm32v6 + - VCS_REV=${DRONE_COMMIT_SHA} + - BUILD_DATE=${DRONE_BUILD_CREATED} + + - name: push image - arm64 + image: plugins/docker + settings: + repo: iamthefij/docker-socket-proxy + auto_tag: true + auto_tag_suffix: linux-arm64 + username: + from_secret: docker_username + password: + from_secret: docker_password + build_args: + - REPO=arm32v6 + - VCS_REV=${DRONE_COMMIT_SHA} + - BUILD_DATE=${DRONE_BUILD_CREATED} + + - name: push image - amd64 + image: plugins/docker + settings: + repo: iamthefij/docker-socket-proxy + auto_tag: true + auto_tag_suffix: linux-amd64 + username: + from_secret: docker_username + password: + from_secret: docker_password + build_args: + - VCS_REV=${DRONE_COMMIT_SHA} + - BUILD_DATE=${DRONE_BUILD_CREATED} + + - name: publish manifest + image: plugins/manifest + settings: + spec: manifest.tmpl + auto_tag: true + ignore_missing: true + username: + from_secret: docker_username + password: + from_secret: docker_password diff --git a/Dockerfile b/Dockerfile index 8d7a62b..2a8dc27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM haproxy:1.9-alpine +ARG REPO=library +FROM ${REPO}/haproxy:1.9-alpine EXPOSE 2375 ENV ALLOW_RESTARTS=0 \ diff --git a/manifest.tmpl b/manifest.tmpl new file mode 100644 index 0000000..b4a35b0 --- /dev/null +++ b/manifest.tmpl @@ -0,0 +1,25 @@ +image: iamthefij/docker-socket-proxy:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: iamthefij/docker-socket-proxy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: iamthefij/docker-socket-proxy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: iamthefij/docker-socket-proxy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7