mirror of https://github.com/linkerd/linkerd2.git
20 lines
883 B
Plaintext
20 lines
883 B
Plaintext
## compile binaries
|
|
FROM gcr.io/runconduit/go-deps:d45c01b4 as golang
|
|
ARG CONDUIT_VERSION
|
|
WORKDIR /go/src/github.com/runconduit/conduit
|
|
COPY cli cli
|
|
COPY controller controller
|
|
COPY pkg pkg
|
|
RUN mkdir -p /out
|
|
ENV GO_LDFLAGS="-s -w -X github.com/runconduit/conduit/pkg/version.Version=${CONDUIT_VERSION}"
|
|
RUN CGO_ENABLED=0 GOOS=darwin go build -installsuffix cgo -o /out/conduit-darwin -ldflags "${GO_LDFLAGS}" ./cli
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o /out/conduit-linux -ldflags "${GO_LDFLAGS}" ./cli
|
|
RUN CGO_ENABLED=0 GOOS=windows go build -installsuffix cgo -o /out/conduit-windows -ldflags "${GO_LDFLAGS}" ./cli
|
|
|
|
## export without sources & dependencies
|
|
FROM scratch
|
|
COPY --from=golang /out /out
|
|
# `ENTRYPOINT` prevents `docker build` from otherwise failing with "Error
|
|
# response from daemon: No command specified."
|
|
ENTRYPOINT ["/out/conduit-linux"]
|