From 596a0180fffb7002dd8ce80a87a6a0f5ab4a6768 Mon Sep 17 00:00:00 2001 From: Sergey Bogatyrets Date: Wed, 20 Nov 2019 21:56:33 +0300 Subject: [PATCH] Playing with args and hooks for docker hub --- Dockerfile | 5 ++++- hooks/build | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 hooks/build diff --git a/Dockerfile b/Dockerfile index 3f9ec72..24dbf45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM golang:latest as builder +ARG ARCH=CIDEFINED +ARG GOLANG_VERSION="1.12" + +FROM $ARCH/golang:$GOLANG_VERSION-alpine as builder WORKDIR /go/src/github.com/olebedev/socks5 COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-s' -o ./socks5 diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..6a6ca45 --- /dev/null +++ b/hooks/build @@ -0,0 +1,7 @@ +#!/bin/sh + +for i in arm32v6 arm32v6 arm64v8 amd64; + do + docker build --build-arg ARCH=$i -t serjs/test:$i . + # $IMAGE_NAME . + done