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

     1  ARG BUILD_BASE
     2  ARG RUN_BASE
     3  ARG KUBERNETES_VERSION
     4  
     5  FROM ${RUN_BASE} AS runbase
     6  RUN apk add ca-certificates --no-cache
     7  
     8  FROM runbase AS unprivileged
     9  RUN adduser -D compose
    10  USER compose
    11  WORKDIR /home/compose
    12  
    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 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  ENTRYPOINT ["/ginkgo","-v", "-p", "--nodes=10", "/e2e.test", "--"]
    44  COPY --from=build /go/bin/ginkgo /ginkgo
    45  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/e2e/e2e.test /e2e.test
    46  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/e2e/retrieve-coverage /retrieve-coverage
    47  COPY --from=build /bin/kubectl /bin/kubectl
    48  
    49  # e2e-benchmark
    50  FROM runbase AS compose-e2e-benchmark
    51  ENTRYPOINT ["/e2e_benchmark", "--kubeconfig=/kind-config", "--"]
    52  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/e2e_benchmark /e2e_benchmark
    53  COPY --from=build /bin/kubectl /bin/kubectl
    54  
    55  # compose-installer (retrieved with --target=compose-installer)
    56  FROM runbase AS compose-installer
    57  ENTRYPOINT ["/installer"]
    58  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/installer /installer
    59  
    60  # compose-api-server (retrieved with --target=compose-api-server)
    61  FROM unprivileged AS compose-api-server
    62  ENTRYPOINT ["/api-server"]
    63  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/api-server /api-server
    64  
    65  # compose-api-server with instrumentation (retrieved with --target=compose-api-server-coverage)
    66  FROM unprivileged AS compose-api-server-coverage
    67  ENTRYPOINT ["/api-server-coverage"]
    68  ADD e2e/api-server-coverage /
    69  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/api-server.test /api-server.test
    70  
    71  # instrumented runtime image (retrieved with --target=compose-controller-coverage)
    72  FROM unprivileged AS compose-controller-coverage
    73  ENTRYPOINT ["/compose-controller-coverage"]
    74  ADD e2e/compose-controller-coverage /
    75  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/compose-controller.test /compose-controller.test
    76  
    77  # main runtime image (default target)
    78  FROM unprivileged
    79  ENTRYPOINT ["/compose-controller"]
    80  COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/compose-controller /compose-controller