Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit b95841c

Browse files
committed
first attempt at multi-stage build
1 parent b6cd902 commit b95841c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
FROM golang:1.11-alpine
1+
FROM golang:1.11-alpine as build-swarmctl
2+
WORKDIR /go/src/github.com/docker
23

3-
RUN apk add --no-cache --update bash ca-certificates curl make git openssh-client unzip jq docker
4+
RUN apk add --no-cache --update bash ca-certificates curl make git openssh-client
5+
RUN git clone https://github.com/docker/swarmkit.git swarmkit && cd swarmkit && make bin/swarmctl && cp bin/swarmctl /usr/bin/swarmctl && rm -rf /go/src/github.com/docker/swarmkit
46

7+
FROM alpine:3.9 as build-protoc
58
# should stay consistent with the version in .circleci/config.yml
69
ARG PROTOC_VERSION=3.6.1
710
# download and install protoc binary and .proto files
811
RUN curl --silent --show-error --location --output protoc.zip \
912
https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip \
1013
&& unzip -d /usr/local protoc.zip include/\* bin/\* \
1114
&& rm -f protoc.zip
12-
WORKDIR /go/src/github.com/docker
13-
RUN git clone https://github.com/docker/swarmkit.git swarmkit && cd swarmkit && make bin/swarmctl && cp bin/swarmctl /usr/bin/swarmctl && rm -rf /go/src/github.com/docker/swarmkit
1415

16+
FROM alpine:3.9
17+
18+
# WORKDIR /go/src/github.com/docker
19+
# RUN git clone https://github.com/docker/swarmkit.git swarmkit && cd swarmkit && make bin/swarmctl && cp bin/swarmctl /usr/bin/swarmctl && rm -rf /go/src/github.com/docker/swarmkit
20+
COPY --from=build-swarmctl /usr/bin/swarmctl /usr/bin/swarmctl
21+
COPY --from=build-protoc /usr/local/. /usr/local
1522
COPY ip-util-check /usr/bin
1623
CMD [ "/usr/bin/ip-util-check" ]

0 commit comments

Comments
 (0)