Dockerfile.e2e
9fe29182
 ARG GO_VERSION=1.13.15
c364e5d1
 
 FROM golang:${GO_VERSION}-alpine AS base
075e057d
 ENV GO111MODULE=off
3b44dd66
 RUN apk --no-cache add \
07f10d8e
     bash \
37553a69
     btrfs-progs-dev \
07f10d8e
     build-base \
     curl \
     lvm2-dev \
3b44dd66
     jq
07f10d8e
 
dc6d1ac6
 RUN mkdir -p /build/
07f10d8e
 RUN mkdir -p /go/src/github.com/docker/docker/
 WORKDIR /go/src/github.com/docker/docker/
 
dc6d1ac6
 FROM base AS frozen-images
 # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
 COPY contrib/download-frozen-image-v2.sh /
 RUN /download-frozen-image-v2.sh /build \
3a971009
 	buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
3ae45c5f
 	busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
 	busybox:glibc@sha256:0b55a30394294ab23b9afd58fab94e61a923f5834fba7ddbae7f8e0c11ba85e6 \
3a971009
 	debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
 	hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
dc6d1ac6
 # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
 
d36c7de1
 FROM base AS dockercli
 ENV INSTALL_BINARY_NAME=dockercli
 COPY hack/dockerfile/install/install.sh ./install.sh
 COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
 RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
07f10d8e
 
7d3405b4
 # Build DockerSuite.TestBuild* dependency
 FROM base AS contrib
 COPY contrib/syscall-test           /build/syscall-test
 COPY contrib/httpserver/Dockerfile  /build/httpserver/Dockerfile
 COPY contrib/httpserver             contrib/httpserver
 RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
 
 # Build the integration tests and copy the resulting binaries to /build/tests
d36c7de1
 FROM base AS builder
07f10d8e
 
86f9eb4a
 # Set tag and add sources
ce9cabf0
 COPY . .
2e954991
 # Copy test sources tests that use assert can print errors
 RUN mkdir -p /build${PWD} && find integration integration-cli -name \*_test.go -exec cp --parents '{}' /build${PWD} \;
 # Build and install test binaries
14bb71d5
 ARG DOCKER_GITCOMMIT=undefined
07f10d8e
 RUN hack/make.sh build-integration-test-binary
2e954991
 RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
07f10d8e
 
dc6d1ac6
 ## Generate testing image
fed832e2
 FROM alpine:3.10 as runner
07f10d8e
 
ce9cabf0
 ENV DOCKER_REMOTE_DAEMON=1
 ENV DOCKER_INTEGRATION_DAEMON_DEST=/
 ENTRYPOINT ["/scripts/run.sh"]
 
 # Add an unprivileged user to be used for tests which need it
 RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
 
07f10d8e
 # GNU tar is used for generating the emptyfs image
3b44dd66
 RUN apk --no-cache add \
07f10d8e
     bash \
     ca-certificates \
     g++ \
     git \
     iptables \
fd35494a
     pigz \
07f10d8e
     tar \
3b44dd66
     xz
07f10d8e
 
ce9cabf0
 COPY hack/test/e2e-run.sh       /scripts/run.sh
 COPY hack/make/.ensure-emptyfs  /scripts/ensure-emptyfs.sh
07f10d8e
 
3afbf83c
 COPY integration/testdata       /tests/integration/testdata
 COPY integration/build/testdata /tests/integration/build/testdata
 COPY integration-cli/fixtures   /tests/integration-cli/fixtures
07f10d8e
 
dc6d1ac6
 COPY --from=frozen-images /build/ /docker-frozen-images
d36c7de1
 COPY --from=dockercli     /build/ /usr/bin/
7d3405b4
 COPY --from=contrib       /build/ /tests/contrib/
2e954991
 COPY --from=builder       /build/ /