mirror of https://github.com/docker/docs.git
Merge pull request #2114 from vieux/GOOS_dockerfile
Add GOOS buildarg in dockerfile
This commit is contained in:
commit
a213794b55
|
@ -1,5 +1,7 @@
|
||||||
FROM golang:1.5.3-alpine
|
FROM golang:1.5.3-alpine
|
||||||
|
|
||||||
|
ARG GOOS
|
||||||
|
|
||||||
COPY . /go/src/github.com/docker/swarm
|
COPY . /go/src/github.com/docker/swarm
|
||||||
WORKDIR /go/src/github.com/docker/swarm
|
WORKDIR /go/src/github.com/docker/swarm
|
||||||
|
|
||||||
|
@ -8,7 +10,7 @@ ENV GOPATH /go/src/github.com/docker/swarm/Godeps/_workspace:$GOPATH
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
&& apk add --no-cache --virtual .build-deps \
|
||||||
git \
|
git \
|
||||||
&& CGO_ENABLED=0 go install -v -a -tags netgo -installsuffix netgo -ldflags "-w -X github.com/docker/swarm/version.GITCOMMIT `git rev-parse --short HEAD` -X github.com/docker/swarm/version.BUILDTIME \"`date -u`\"" \
|
&& GOOS=$GOOS CGO_ENABLED=0 go install -v -a -tags netgo -installsuffix netgo -ldflags "-w -X github.com/docker/swarm/version.GITCOMMIT `git rev-parse --short HEAD` -X github.com/docker/swarm/version.BUILDTIME \"`date -u`\"" \
|
||||||
&& apk del .build-deps
|
&& apk del .build-deps
|
||||||
|
|
||||||
ENV SWARM_HOST :2375
|
ENV SWARM_HOST :2375
|
||||||
|
|
Loading…
Reference in New Issue