From 646fc9702ca43365be96ef2127be0bac8e0b0817 Mon Sep 17 00:00:00 2001 From: Elton Stoneman Date: Tue, 23 May 2017 09:58:05 +0100 Subject: [PATCH] Add ARGs for cross-compiling Add build args. Defaults to Linux/x64 so no change to existing image, but can build for other platforms - e.g. ``` docker build --build-arg GOOS=windows -t distribution-builder:windows . ``` Signed-off-by: Elton Stoneman --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index b0d06f12f..ac8dbca2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,9 @@ FROM golang:1.8-alpine ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution ENV DOCKER_BUILDTAGS include_oss include_gcs +ARG GOOS=linux +ARG GOARCH=amd64 + RUN set -ex \ && apk add --no-cache make git