woodpecker-docker-buildx/Dockerfile.multiarch
Lauris BH 051ea11a5c bump buildx to v0.11.0 (#66)
- use buildx [v0.11.0](https://github.com/docker/buildx/releases/tag/v0.11.0)

Reviewed-on: https://codeberg.org/woodpecker-plugins/docker-buildx/pulls/66
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lafriks@noreply.codeberg.org>
Co-committed-by: Lauris BH <lafriks@noreply.codeberg.org>
2023-06-27 13:57:45 +00:00

27 lines
757 B
Docker

ARG BUILDX_VERSION=0.11.0
ARG DOCKER_VERSION=20.10-dind
ARG GOLANG_VERSION=1.20
FROM --platform=$BUILDPLATFORM golang:${GOLANG_VERSION} as build
COPY . /src
WORKDIR /src
ARG TARGETOS TARGETARCH
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
make build
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx-bin
FROM docker:${DOCKER_VERSION}
RUN apk --update --no-cache add coredns
COPY --from=build /src/Corefile /etc/coredns/Corefile
COPY --from=buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx
COPY --from=build /src/plugin-docker-buildx /bin/plugin-docker-buildx
ENV DOCKER_HOST=unix:///var/run/docker.sock
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "plugin-docker-buildx"]