This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS build | |
WORKDIR /go/src/github.com/docker/cli | |
ENV GO111MODULE=auto | |
ARG TARGETOS TARGETARCH | |
RUN --mount=target=. \ | |
--mount=type=cache,target=/root/.cache/go-build \ | |
--mount=type=cache,target=/go/pkg \ | |
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/docker ./cmd/docker | |
FROM alpine | |
COPY --from=build /out/docker /bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.17-alpine AS build | |
WORKDIR /go/src/github.com/docker/cli | |
COPY . . | |
ENV GO111MODULE=auto | |
RUN go build -o /out/docker ./cmd/docker | |
FROM alpine | |
COPY --from=build /out/docker /bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment