woodpecker-docker-buildx/Dockerfile

29 lines
881 B
Docker
Raw Normal View History

FROM golang:1.18-alpine as build
2021-01-10 22:47:55 +00:00
2021-10-13 05:14:04 +00:00
COPY . /src
WORKDIR /src
RUN go build -v -a -tags netgo -o docker-buildx ./cmd/docker-buildx
2021-10-13 05:14:04 +00:00
FROM docker:20.10-dind
2021-01-10 22:47:55 +00:00
ARG BUILDX_VERSION
# renovate: datasource=github-releases depName=docker/buildx
ENV BUILDX_VERSION="${BUILDX_VERSION:-v0.9.1}"
2021-01-10 22:47:55 +00:00
ENV DOCKER_HOST=unix:///var/run/docker.sock
2021-10-13 05:14:04 +00:00
RUN \
apk --update add --virtual .build-deps curl && \
2021-01-10 22:47:55 +00:00
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" && \
2021-01-10 22:47:55 +00:00
chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
2021-10-13 05:14:04 +00:00
COPY --from=build /src/docker-buildx /bin/docker-buildx
2021-01-10 22:47:55 +00:00
2021-10-13 05:14:04 +00:00
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "docker-buildx"]