1
0
mirror of https://github.com/Tecnativa/docker-socket-proxy synced 2024-11-27 10:28:18 +00:00

First stab at multi-arch builds

This commit is contained in:
ViViDboarder 2019-07-19 16:32:49 -07:00 committed by Jairo Llopis
parent f16482ddff
commit e46d26a7c4
2 changed files with 35 additions and 1 deletions

View File

@ -1,4 +1,5 @@
FROM haproxy:1.9-alpine ARG REPO=library
FROM ${REPO}/haproxy:1.9-alpine
EXPOSE 2375 EXPOSE 2375
ENV ALLOW_RESTARTS=0 \ ENV ALLOW_RESTARTS=0 \

View File

@ -1,7 +1,40 @@
#!/bin/bash #!/bin/bash
set -ex set -ex
# Extract arch repo from a docker tag suffix
REPO=""
case "$DOCKER_TAG" in
*amd64)
REPO="library"
;;
*arm32v5)
REPO="arm32v5"
;;
*arm32v6)
REPO="arm32v6"
;;
*arm32v7)
REPO="arm32v7"
;;
*arm64v8)
REPO="arm64v8"
;;
*i386)
REPO="i386"
;;
*ppc64le)
REPO="ppc64le"
;;
*s390x)
REPO="s390x"
;;
*)
REPO="library"
;;
esac
docker build \ docker build \
--build-arg REPO="$REPO" \
--build-arg VCS_REF="$GIT_SHA1" \ --build-arg VCS_REF="$GIT_SHA1" \
--build-arg BUILD_DATE="$(date --rfc-3339 ns)" \ --build-arg BUILD_DATE="$(date --rfc-3339 ns)" \
--tag "$IMAGE_NAME" . --tag "$IMAGE_NAME" .