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 <elton@sixeyed.com>
This commit is contained in:
Elton Stoneman 2017-05-23 09:58:05 +01:00
parent a528cc1fc3
commit 646fc9702c

View file

@ -3,6 +3,9 @@ FROM golang:1.8-alpine
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
ENV DOCKER_BUILDTAGS include_oss include_gcs ENV DOCKER_BUILDTAGS include_oss include_gcs
ARG GOOS=linux
ARG GOARCH=amd64
RUN set -ex \ RUN set -ex \
&& apk add --no-cache make git && apk add --no-cache make git