2017-09-12 08:53:20 -04:00
|
|
|
## Step 1: Build tests
|
2018-10-02 16:41:31 -04:00
|
|
|
FROM golang:1.11.1-alpine3.7 as builder
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2018-10-02 20:57:42 -04:00
|
|
|
RUN apk --no-cache add \
|
2017-09-08 10:43:04 -04:00
|
|
|
bash \
|
2017-11-03 05:09:06 -04:00
|
|
|
btrfs-progs-dev \
|
2017-09-08 10:43:04 -04:00
|
|
|
build-base \
|
|
|
|
curl \
|
|
|
|
lvm2-dev \
|
2018-10-02 20:57:42 -04:00
|
|
|
jq
|
2017-09-08 10:43:04 -04:00
|
|
|
|
|
|
|
RUN mkdir -p /go/src/github.com/docker/docker/
|
|
|
|
WORKDIR /go/src/github.com/docker/docker/
|
|
|
|
|
2017-09-12 08:53:20 -04:00
|
|
|
# Generate frozen images
|
|
|
|
COPY contrib/download-frozen-image-v2.sh contrib/download-frozen-image-v2.sh
|
2017-09-08 10:43:04 -04:00
|
|
|
RUN contrib/download-frozen-image-v2.sh /output/docker-frozen-images \
|
2018-02-12 23:52:10 -05:00
|
|
|
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
|
2018-02-27 01:28:29 -05:00
|
|
|
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
|
|
|
|
busybox:glibc@sha256:0b55a30394294ab23b9afd58fab94e61a923f5834fba7ddbae7f8e0c11ba85e6 \
|
2018-02-12 23:52:10 -05:00
|
|
|
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
|
|
|
|
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2018-02-22 04:51:50 -05:00
|
|
|
# Install dockercli
|
|
|
|
# Please edit hack/dockerfile/install/<name>.installer to update them.
|
|
|
|
COPY hack/dockerfile/install hack/dockerfile/install
|
|
|
|
RUN ./hack/dockerfile/install/install.sh dockercli
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2017-09-12 08:53:20 -04:00
|
|
|
# Set tag and add sources
|
|
|
|
ARG DOCKER_GITCOMMIT
|
2018-02-22 04:51:50 -05:00
|
|
|
ENV DOCKER_GITCOMMIT=${DOCKER_GITCOMMIT:-undefined}
|
2017-09-08 10:43:04 -04:00
|
|
|
ADD . .
|
|
|
|
|
2017-09-12 08:53:20 -04:00
|
|
|
# Build DockerSuite.TestBuild* dependency
|
2017-08-02 09:07:36 -04:00
|
|
|
RUN CGO_ENABLED=0 go build -buildmode=pie -o /output/httpserver github.com/docker/docker/contrib/httpserver
|
2017-09-12 08:53:20 -04:00
|
|
|
|
|
|
|
# Build the integration tests and copy the resulting binaries to /output/tests
|
2017-09-08 10:43:04 -04:00
|
|
|
RUN hack/make.sh build-integration-test-binary
|
|
|
|
RUN mkdir -p /output/tests && find . -name test.main -exec cp --parents '{}' /output/tests \;
|
|
|
|
|
2017-09-12 08:53:20 -04:00
|
|
|
## Step 2: Generate testing image
|
2017-12-07 20:10:04 -05:00
|
|
|
FROM alpine:3.7 as runner
|
2017-09-08 10:43:04 -04:00
|
|
|
|
|
|
|
# GNU tar is used for generating the emptyfs image
|
2018-10-02 20:57:42 -04:00
|
|
|
RUN apk --no-cache add \
|
2017-09-08 10:43:04 -04:00
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
g++ \
|
|
|
|
git \
|
|
|
|
iptables \
|
2018-01-16 13:49:18 -05:00
|
|
|
pigz \
|
2017-09-08 10:43:04 -04:00
|
|
|
tar \
|
2018-10-02 20:57:42 -04:00
|
|
|
xz
|
2017-09-08 10:43:04 -04:00
|
|
|
|
|
|
|
# Add an unprivileged user to be used for tests which need it
|
|
|
|
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
|
|
|
|
|
2017-09-12 08:53:20 -04:00
|
|
|
COPY contrib/httpserver/Dockerfile /tests/contrib/httpserver/Dockerfile
|
|
|
|
COPY contrib/syscall-test /tests/contrib/syscall-test
|
|
|
|
COPY integration-cli/fixtures /tests/integration-cli/fixtures
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2017-09-14 13:17:49 -04:00
|
|
|
COPY hack/test/e2e-run.sh /scripts/run.sh
|
|
|
|
COPY hack/make/.ensure-emptyfs /scripts/ensure-emptyfs.sh
|
|
|
|
|
2017-09-08 10:43:04 -04:00
|
|
|
COPY --from=builder /output/docker-frozen-images /docker-frozen-images
|
2017-09-12 08:53:20 -04:00
|
|
|
COPY --from=builder /output/httpserver /tests/contrib/httpserver/httpserver
|
2017-09-08 10:43:04 -04:00
|
|
|
COPY --from=builder /output/tests /tests
|
2017-09-12 08:53:20 -04:00
|
|
|
COPY --from=builder /usr/local/bin/docker /usr/bin/docker
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2017-09-14 13:17:49 -04:00
|
|
|
ENV DOCKER_REMOTE_DAEMON=1 DOCKER_INTEGRATION_DAEMON_DEST=/
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2017-09-14 13:17:49 -04:00
|
|
|
ENTRYPOINT ["/scripts/run.sh"]
|