github.com/docker/compose-on-kubernetes@v0.5.0/Dockerfile.debuggable (about) 1 # syntax = tonistiigi/dockerfile:runmount20180607 2 ARG BUILD_BASE 3 ARG RUN_BASE 4 5 FROM ${BUILD_BASE} AS build 6 ENV GO111MODULE=off 7 RUN apk add --no-cache \ 8 coreutils \ 9 make \ 10 git 11 ARG GOPROXY 12 13 RUN --mount=target=/root/.cache,type=cache git clone https://github.com/derekparker/delve.git /go/src/github.com/derekparker/delve && \ 14 cd /go/src/github.com/derekparker/delve && \ 15 git checkout v1.1.0 && \ 16 make install 17 WORKDIR /go/src/github.com/docker/compose-on-kubernetes 18 COPY . . 19 ARG BUILDTIME 20 ARG GITCOMMIT 21 ARG VERSION 22 ARG IMAGE_REPO_PREFIX 23 ENV GITCOMMIT=$GITCOMMIT VERSION=$VERSION BUILDTIME=$BUILDTIME IMAGE_REPO_PREFIX=$IMAGE_REPO_PREFIX 24 ENV CGO_ENABLED=0 25 RUN --mount=target=/root/.cache,type=cache make DEBUG=true bin/compose-controller bin/api-server 26 27 28 FROM ${RUN_BASE} AS runbase 29 RUN apk add ca-certificates --no-cache 30 COPY --from=build /go/bin/dlv / 31 WORKDIR /go/src/github.com/docker/compose-on-kubernetes 32 COPY . . 33 34 # compose-api-server with debug symbols 35 FROM runbase AS compose-api-server-debug 36 ENTRYPOINT ["/api-server"] 37 COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/api-server /api-server 38 39 # compose-api-server with remote debugging 40 FROM compose-api-server-debug AS compose-api-server-live-debug 41 ENTRYPOINT ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient=true", "exec", "/api-server", "--"] 42 43 # compose-controller with debug symbols 44 FROM runbase AS compose-controller-debug 45 ENTRYPOINT ["/compose-controller", "--log-level", "debug"] 46 COPY --from=build /go/src/github.com/docker/compose-on-kubernetes/bin/compose-controller /compose-controller 47 48 FROM compose-controller-debug AS compose-controller-live-debug 49 ENTRYPOINT ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient=true", "exec", "/compose-controller", "--"]