You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
564 B
Docker
22 lines
564 B
Docker
# syntax = docker/dockerfile:experimental
|
|
|
|
FROM --platform=${BUILDPLATFORM} golang:1.15.5 AS builder
|
|
|
|
WORKDIR /go/src
|
|
|
|
COPY ./ ./
|
|
|
|
ARG GOPROXY
|
|
RUN --mount=type=cache,id=gomod,target=/go/pkg/mod go mod download
|
|
|
|
ARG TARGETARCH
|
|
RUN --mount=type=cache,id=gomod,target=/go/pkg/mod CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -o /go/bin/docker-buildx-${TARGETARCH} ./cmd/buildx;
|
|
|
|
FROM docker
|
|
|
|
RUN apk add --no-cache make
|
|
|
|
ARG TARGETARCH
|
|
COPY --from=builder /go/bin/docker-buildx-${TARGETARCH} /root/.docker/cli-plugins/docker-buildx
|
|
|
|
ENV DOCKER_CLI_EXPERIMENTAL=enabled |