Fixes for dnephin review

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 86f9eb4a085a61b3355dc38452c47def806bf7c9
Component: engine
This commit is contained in:
Christopher Crone
2017-09-14 19:27:09 +02:00
parent f23d5bec57
commit 4d643fb18a
16 changed files with 79 additions and 120 deletions
+23 -15
View File
@@ -1,3 +1,4 @@
## Step 1: Build tests
FROM golang:1.8.3-alpine3.6 as builder
RUN apk add --update \
@@ -11,26 +12,31 @@ RUN apk add --update \
RUN mkdir -p /go/src/github.com/docker/docker/
WORKDIR /go/src/github.com/docker/docker/
COPY contrib contrib
# Generate frozen images
COPY contrib/download-frozen-image-v2.sh contrib/download-frozen-image-v2.sh
RUN contrib/download-frozen-image-v2.sh /output/docker-frozen-images \
buildpack-deps:jessie@sha256:85b379ec16065e4fe4127eb1c5fb1bcc03c559bd36dbb2e22ff496de55925fa6 \
busybox:latest@sha256:32f093055929dbc23dec4d03e09dfe971f5973a9ca5cf059cbfb644c206aa83f \
debian:jessie@sha256:72f784399fd2719b4cb4e16ef8e369a39dc67f53d978cd3e2e7bf4e502c7b793 \
hello-world:latest@sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
# Download Docker CLI binary
COPY hack/dockerfile hack/dockerfile
RUN hack/dockerfile/install-binaries.sh dockercli
# Set tag and add sources
ARG DOCKER_GITCOMMIT
ENV DOCKER_GITCOMMIT=$DOCKER_GITCOMMIT
# integration-cli tests are frozen to 17.06
# Newer CLI tests can be found in the docker/cli repository
RUN curl https://download.docker.com/linux/static/stable/x86_64/docker-17.06.2-ce.tgz | tar xzf - -C /output
ADD . .
# Build DockerSuite.TestBuild* dependency
RUN CGO_ENABLED=0 go build -o /output/httpserver github.com/docker/docker/contrib/httpserver
# Build the integration tests and copy the resulting binaries to /output/tests
RUN hack/make.sh build-integration-test-binary
RUN mkdir -p /output/tests && find . -name test.main -exec cp --parents '{}' /output/tests \;
## Step 2: Generate testing image
FROM alpine:3.6 as runner
# GNU tar is used for generating the emptyfs image
@@ -47,15 +53,17 @@ RUN apk add --update \
# Add an unprivileged user to be used for tests which need it
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
ENV DOCKER_E2E=1 DOCKER_REMOTE_DAEMON=1 DOCKER_INTEGRATION_DAEMON_DEST=/
COPY --from=builder /output/docker/docker /usr/bin/docker
COPY --from=builder /output/docker-frozen-images /docker-frozen-images
COPY --from=builder /output/tests /tests
COPY contrib /tests/contrib
COPY contrib/httpserver/Dockerfile /tests/contrib/httpserver/Dockerfile
COPY contrib/syscall-test /tests/contrib/syscall-test
COPY hack/test/e2e-run.sh /run.sh
COPY hack/make/.ensure-emptyfs /ensure-emptyfs.sh
COPY integration-cli/fixtures /tests/integration-cli/fixtures
COPY internal/e2e/run.sh /run.sh
COPY --from=builder /output/docker-frozen-images /docker-frozen-images
COPY --from=builder /output/httpserver /tests/contrib/httpserver/httpserver
COPY --from=builder /output/tests /tests
COPY --from=builder /usr/local/bin/docker /usr/bin/docker
ENV DOCKER_E2E=1 DOCKER_REMOTE_DAEMON=1 DOCKER_INTEGRATION_DAEMON_DEST=/
ENTRYPOINT ["/run.sh"]