Skip to content

Commit 3ededb8

Browse files
committed
Dockerfile.e2e: move "contrib" to a separate build-stage
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent e7784a6 commit 3ededb8

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

Dockerfile.e2e

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@ COPY hack/dockerfile/install/install.sh ./install.sh
2929
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
3030
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
3131

32+
# Build DockerSuite.TestBuild* dependency
33+
FROM base AS contrib
34+
COPY contrib/syscall-test /build/syscall-test
35+
COPY contrib/httpserver/Dockerfile /build/httpserver/Dockerfile
36+
COPY contrib/httpserver contrib/httpserver
37+
RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
38+
39+
# Build the integration tests and copy the resulting binaries to /build/tests
3240
FROM base AS builder
3341

3442
# Set tag and add sources
3543
ARG DOCKER_GITCOMMIT
3644
ENV DOCKER_GITCOMMIT=${DOCKER_GITCOMMIT:-undefined}
3745
COPY . .
38-
39-
# Build DockerSuite.TestBuild* dependency
40-
RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver github.com/docker/docker/contrib/httpserver
41-
42-
# Build the integration tests and copy the resulting binaries to /build/tests
4346
RUN hack/make.sh build-integration-test-binary
4447
RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
4548

@@ -67,13 +70,11 @@ RUN apk --no-cache add \
6770
COPY hack/test/e2e-run.sh /scripts/run.sh
6871
COPY hack/make/.ensure-emptyfs /scripts/ensure-emptyfs.sh
6972

70-
COPY contrib/httpserver/Dockerfile /tests/contrib/httpserver/Dockerfile
71-
COPY contrib/syscall-test /tests/contrib/syscall-test
7273
COPY integration/testdata /tests/integration/testdata
7374
COPY integration/build/testdata /tests/integration/build/testdata
7475
COPY integration-cli/fixtures /tests/integration-cli/fixtures
7576

7677
COPY --from=frozen-images /build/ /docker-frozen-images
7778
COPY --from=dockercli /build/ /usr/bin/
78-
COPY --from=builder /build/httpserver /tests/contrib/httpserver/httpserver
79+
COPY --from=contrib /build/ /tests/contrib/
7980
COPY --from=builder /build/tests /tests

0 commit comments

Comments
 (0)