Publish arm image too (#21)
base image (https://hub.docker.com/_/docker/tags?page=1&name=20.10-dind) do support amd64 and arm64 so we can do too Reviewed-on: https://codeberg.org/woodpecker-plugins/plugin-docker-buildx/pulls/21
This commit is contained in:
31
Dockerfile.multiarch
Normal file
31
Dockerfile.multiarch
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM --platform=$BUILDPLATFORM golang:1.18 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:20.10-dind
|
||||
|
||||
ARG BUILDX_VERSION
|
||||
|
||||
# renovate: datasource=github-releases depName=docker/buildx
|
||||
ENV BUILDX_VERSION="${BUILDX_VERSION:-v0.9.1}"
|
||||
|
||||
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
||||
|
||||
RUN \
|
||||
apk --update add --virtual .build-deps curl && \
|
||||
mkdir -p /usr/lib/docker/cli-plugins/ && \
|
||||
curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION##v}/buildx-v${BUILDX_VERSION##v}.linux-amd64" && \
|
||||
chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \
|
||||
apk del .build-deps && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
rm -rf /tmp/*
|
||||
|
||||
COPY --from=build /src/docker-buildx /bin/docker-buildx
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "docker-buildx"]
|
||||
Reference in New Issue
Block a user