2022-08-30 18:57:03 +00:00
|
|
|
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
|
|
|
|
|
2022-09-28 00:22:04 +00:00
|
|
|
RUN CGO_ENABLED=0 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
|
2022-09-20 16:47:22 +00:00
|
|
|
ENV BUILDX_VERSION="${BUILDX_VERSION:-v0.9.1}"
|
2021-02-15 19:18:31 +00:00
|
|
|
|
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/ && \
|
2021-02-15 19:18:31 +00:00
|
|
|
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"]
|