github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/Dockerfile.e2e (about)

     1  ARG GO_VERSION=1.19.3
     2  
     3  FROM golang:${GO_VERSION}-alpine AS base
     4  ENV GO111MODULE=off
     5  RUN apk --no-cache add \
     6      bash \
     7      btrfs-progs-dev \
     8      build-base \
     9      curl \
    10      lvm2-dev \
    11      jq
    12  
    13  RUN mkdir -p /build/
    14  RUN mkdir -p /go/src/github.com/docker/docker/
    15  WORKDIR /go/src/github.com/docker/docker/
    16  
    17  FROM base AS frozen-images
    18  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
    19  COPY contrib/download-frozen-image-v2.sh /
    20  RUN /download-frozen-image-v2.sh /build \
    21          busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
    22          busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
    23          debian:bullseye-slim@sha256:dacf278785a4daa9de07596ec739dbc07131e189942772210709c5c0777e8437 \
    24          hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 \
    25          arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1
    26  # See also frozenImages in "testutil/environment/protect.go" (which needs to be updated when adding images to this list)
    27  
    28  FROM base AS dockercli
    29  COPY hack/dockerfile/install/install.sh ./install.sh
    30  COPY hack/dockerfile/install/dockercli.installer ./
    31  RUN PREFIX=/build ./install.sh dockercli
    32  
    33  # TestDockerCLIBuildSuite dependency
    34  FROM base AS contrib
    35  COPY contrib/syscall-test           /build/syscall-test
    36  COPY contrib/httpserver/Dockerfile  /build/httpserver/Dockerfile
    37  COPY contrib/httpserver             contrib/httpserver
    38  RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
    39  
    40  # Build the integration tests and copy the resulting binaries to /build/tests
    41  FROM base AS builder
    42  
    43  # Set tag and add sources
    44  COPY . .
    45  # Copy test sources tests that use assert can print errors
    46  RUN mkdir -p /build${PWD} && find integration integration-cli -name \*_test.go -exec cp --parents '{}' /build${PWD} \;
    47  # Build and install test binaries
    48  ARG DOCKER_GITCOMMIT=undefined
    49  RUN hack/make.sh build-integration-test-binary
    50  RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
    51  
    52  ## Generate testing image
    53  FROM alpine:3.10 as runner
    54  
    55  ENV DOCKER_REMOTE_DAEMON=1
    56  ENV DOCKER_INTEGRATION_DAEMON_DEST=/
    57  ENTRYPOINT ["/scripts/run.sh"]
    58  
    59  # Add an unprivileged user to be used for tests which need it
    60  RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
    61  
    62  # GNU tar is used for generating the emptyfs image
    63  RUN apk --no-cache add \
    64      bash \
    65      ca-certificates \
    66      g++ \
    67      git \
    68      inetutils-ping \
    69      iptables \
    70      libcap2-bin \
    71      pigz \
    72      tar \
    73      xz
    74  
    75  COPY hack/test/e2e-run.sh       /scripts/run.sh
    76  COPY hack/make/.ensure-emptyfs  /scripts/ensure-emptyfs.sh
    77  
    78  COPY integration/testdata       /tests/integration/testdata
    79  COPY integration/build/testdata /tests/integration/build/testdata
    80  COPY integration-cli/fixtures   /tests/integration-cli/fixtures
    81  
    82  COPY --from=frozen-images /build/ /docker-frozen-images
    83  COPY --from=dockercli     /build/ /usr/bin/
    84  COPY --from=contrib       /build/ /tests/contrib/
    85  COPY --from=builder       /build/ /