Browse code

Dockerfile.e2e: move dockercli to a separate build-stage

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/04/19 23:24:33
Showing 1 changed files
... ...
@@ -23,12 +23,13 @@ RUN /download-frozen-image-v2.sh /build \
23 23
 	hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
24 24
 # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
25 25
 
26
-FROM base AS builder
26
+FROM base AS dockercli
27
+ENV INSTALL_BINARY_NAME=dockercli
28
+COPY hack/dockerfile/install/install.sh ./install.sh
29
+COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
30
+RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
27 31
 
28
-# Install dockercli
29
-# Please edit hack/dockerfile/install/<name>.installer to update them.
30
-COPY hack/dockerfile/install hack/dockerfile/install
31
-RUN ./hack/dockerfile/install/install.sh dockercli
32
+FROM base AS builder
32 33
 
33 34
 # Set tag and add sources
34 35
 ARG DOCKER_GITCOMMIT
... ...
@@ -73,6 +74,6 @@ COPY integration/build/testdata /tests/integration/build/testdata
73 73
 COPY integration-cli/fixtures   /tests/integration-cli/fixtures
74 74
 
75 75
 COPY --from=frozen-images /build/ /docker-frozen-images
76
+COPY --from=dockercli     /build/ /usr/bin/
76 77
 COPY --from=builder /build/httpserver /tests/contrib/httpserver/httpserver
77 78
 COPY --from=builder /build/tests /tests
78
-COPY --from=builder /usr/local/bin/docker /usr/bin/docker