1- FROM dockercore/golang-cross:1.12.9@sha256:3ea9dcef4dd2c46d80445c0b22d6177817f4cfce22c523cc12a5a1091cb37705 AS build
1+ FROM dockercore/golang-cross:1.12.9@sha256:3ea9dcef4dd2c46d80445c0b22d6177817f4cfce22c523cc12a5a1091cb37705 AS cli- build
22ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
33
44RUN apt-get install -y -q --no-install-recommends \
@@ -11,13 +11,19 @@ WORKDIR /go/src/github.com/docker/cli
1111RUN git clone https://github.com/docker/cli . && git checkout a1b83ffd2cbeefc0752e5aa7a543d49c1ddfd2cb
1212
1313ARG GOPROXY
14- RUN make binary-osx binary-windows binary && \
15- cp build/docker-linux-amd64 /usr/bin/docker
14+ RUN make binary-osx binary-windows binary
15+
16+ # main dev image
17+ FROM golang:1.13.3 AS dev
18+
19+ RUN apt-get update && apt-get install -y -q --no-install-recommends \
20+ coreutils \
21+ util-linux \
22+ uuid-runtime
1623
1724WORKDIR /go/src/github.com/docker/app/
25+ COPY --from=cli-build /go/src/github.com/docker/cli/build/docker-linux-amd64 /usr/bin/docker
1826
19- # main dev image
20- FROM build AS dev
2127ENV PATH=${PATH}:/go/src/github.com/docker/app/bin/
2228ARG DEP_VERSION=v0.5.4
2329RUN curl -o /usr/bin/dep -L https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && \
@@ -44,9 +50,9 @@ RUN go get -d gopkg.in/mjibson/esc.v0 && \
4450COPY . .
4551
4652FROM scratch AS cli
47- COPY --from=build /go/src/github.com/docker/cli/build/docker-linux-amd64 docker-linux
48- COPY --from=build /go/src/github.com/docker/cli/build/docker-darwin-amd64 docker-darwin
49- COPY --from=build /go/src/github.com/docker/cli/build/docker-windows-amd64 docker-windows.exe
53+ COPY --from=cli- build /go/src/github.com/docker/cli/build/docker-linux-amd64 docker-linux
54+ COPY --from=cli- build /go/src/github.com/docker/cli/build/docker-darwin-amd64 docker-darwin
55+ COPY --from=cli- build /go/src/github.com/docker/cli/build/docker-windows-amd64 docker-windows.exe
5056
5157FROM dev AS cross-build
5258ARG TAG="unknown"
0 commit comments