2a6325e3 |
ARG GO_VERSION=1.13.15 |
c6281bc4 |
FROM golang:${GO_VERSION}-alpine AS base |
961119db |
ENV GO111MODULE=off |
3b44dd66 |
RUN apk --no-cache add \ |
07f10d8e |
bash \ |
37553a69 |
btrfs-progs-dev \ |
07f10d8e |
build-base \
curl \
lvm2-dev \ |
3b44dd66 |
jq |
07f10d8e |
|
5554bd1a |
RUN mkdir -p /build/ |
07f10d8e |
RUN mkdir -p /go/src/github.com/docker/docker/
WORKDIR /go/src/github.com/docker/docker/
|
5554bd1a |
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 \ |
228d7484 |
buildpack-deps:buster@sha256:d0abb4b1e5c664828b93e8b6ac84d10bce45ee469999bef88304be04a2709491 \
busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
busybox:glibc@sha256:1f81263701cddf6402afe9f33fca0266d9fff379e59b1748f33d3072da71ee85 \ |
1c5806cf |
debian:bullseye@sha256:7190e972ab16aefea4d758ebe42a293f4e5c5be63595f4d03a5b9bf6839a4344 \ |
228d7484 |
hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 |
1c5806cf |
# See also frozenImages in "testutil/environment/protect.go" (which needs to be updated when adding images to this list) |
5554bd1a |
|
e7784a6c |
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 |
|
3ededb85 |
# 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 |
e7784a6c |
FROM base AS builder |
07f10d8e |
|
86f9eb4a |
# Set tag and add sources |
63aefbfb |
COPY . . |
0deb18ab |
# 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 |
c3b24944 |
ARG DOCKER_GITCOMMIT=undefined |
07f10d8e |
RUN hack/make.sh build-integration-test-binary |
0deb18ab |
RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \; |
07f10d8e |
|
5554bd1a |
## Generate testing image |
330bf329 |
FROM alpine:3.10 as runner |
07f10d8e |
|
63aefbfb |
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 |
|
63aefbfb |
COPY hack/test/e2e-run.sh /scripts/run.sh
COPY hack/make/.ensure-emptyfs /scripts/ensure-emptyfs.sh |
07f10d8e |
|
48fd0e92 |
COPY integration/testdata /tests/integration/testdata
COPY integration/build/testdata /tests/integration/build/testdata
COPY integration-cli/fixtures /tests/integration-cli/fixtures |
07f10d8e |
|
5554bd1a |
COPY --from=frozen-images /build/ /docker-frozen-images |
e7784a6c |
COPY --from=dockercli /build/ /usr/bin/ |
3ededb85 |
COPY --from=contrib /build/ /tests/contrib/ |
0deb18ab |
COPY --from=builder /build/ / |