github.com/docker/compose-on-kubernetes@v0.5.0/Dockerfile.buildkit (about)

     1  # syntax = docker/dockerfile-upstream:1.0.1-experimental
     2  ARG BUILD_BASE
     3  ARG RUN_BASE
     4  ARG KUBERNETES_VERSION
     5  
     6  FROM ${RUN_BASE} AS runbase
     7  RUN apk add ca-certificates --no-cache
     8  
     9  FROM runbase AS unprivileged
    10  RUN adduser -D compose
    11  USER compose
    12  WORKDIR /home/compose
    13  
    14  FROM ${BUILD_BASE} AS build
    15  ENV GO111MODULE=off
    16  
    17  RUN apk add --no-cache \
    18    coreutils \
    19    make \
    20    git \
    21    curl
    22  
    23  ARG GOPROXY
    24  
    25  WORKDIR /go/src/github.com/docker/compose-on-kubernetes
    26  COPY . .
    27  ARG BUILDTIME
    28  ARG GITCOMMIT
    29  ARG VERSION
    30  ARG IMAGE_REPO_PREFIX
    31  ARG KUBERNETES_VERSION
    32  ENV GITCOMMIT=$GITCOMMIT VERSION=$VERSION BUILDTIME=$BUILDTIME IMAGE_REPO_PREFIX=$IMAGE_REPO_PREFIX KUBERNETES_VERSION=$KUBERNETES_VERSION
    33  ENV CGO_ENABLED=0
    34  RUN --mount=target=/root/.cache,type=cache make bin/compose-controller bin/compose-controller.test e2e-binary bin/installer bin/api-server bin/api-server.test bin/e2e_benchmark
    35  RUN GO111MODULE=on go install github.com/onsi/ginkgo/ginkgo@v1.16.5
    36  RUN curl -fLO https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl && \
    37    chmod +x ./kubectl && \
    38    mv ./kubectl /bin/kubectl
    39  
    40  # e2e-tests (retrieved with --target=compose-e2e-tests)
    41  # image is publised as docker/kube-compose-e2e-tests, and used for docker/orca e2e tests
    42  FROM runbase AS compose-e2e-tests
    43  RUN apk add jq --no-cache
    44  ENTRYPOINT ["/ginkgo","-v", "-p", "--nodes=10", "/e2e.test", "--"]
    45  COPY --from=build /go/bin/ginkgo /ginkgo
    46  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/e2e/e2e.test /e2e.test
    47  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/e2e/retrieve-coverage /retrieve-coverage
    48  COPY --from=build /bin/kubectl /bin/kubectl
    49  
    50  # e2e-benchmark
    51  FROM runbase AS compose-e2e-benchmark
    52  ENTRYPOINT ["/e2e_benchmark", "--kubeconfig=/kind-config", "--"]
    53  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/e2e_benchmark /e2e_benchmark
    54  COPY --from=build /bin/kubectl /bin/kubectl
    55  
    56  # compose-installer (retrieved with --target=compose-installer)
    57  FROM runbase AS compose-installer
    58  ENTRYPOINT ["/installer"]
    59  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/installer /installer
    60  
    61  # compose-api-server (retrieved with --target=compose-api-server)
    62  FROM unprivileged AS compose-api-server
    63  ENTRYPOINT ["/api-server"]
    64  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/api-server /api-server
    65  
    66  # compose-api-server with instrumentation (retrieved with --target=compose-api-server-coverage)
    67  FROM unprivileged AS compose-api-server-coverage
    68  ENTRYPOINT ["/api-server-coverage"]
    69  ADD e2e/api-server-coverage /
    70  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/api-server.test /api-server.test
    71  
    72  # instrumented runtime image (retrieved with --target=compose-controller-coverage)
    73  FROM unprivileged AS compose-controller-coverage
    74  ENTRYPOINT ["/compose-controller-coverage"]
    75  ADD e2e/compose-controller-coverage /
    76  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/compose-controller.test /compose-controller.test
    77  
    78  # main runtime image (default target)
    79  FROM unprivileged
    80  ENTRYPOINT ["/compose-controller"]
    81  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/compose-controller /compose-controller