2023-03-22 15:26:29 +00:00
|
|
|
ARG BUILDX_VERSION=0.10.4
|
2022-10-07 22:58:57 +00:00
|
|
|
ARG DOCKER_VERSION=20.10-dind
|
2023-03-22 15:26:29 +00:00
|
|
|
ARG GOLANG_VERSION=1.20
|
2022-10-07 22:58:57 +00:00
|
|
|
|
|
|
|
FROM --platform=$BUILDPLATFORM golang:${GOLANG_VERSION} 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 01:12:21 +00:00
|
|
|
ARG TARGETOS TARGETARCH
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
|
|
--mount=type=cache,target=/go/pkg \
|
|
|
|
make build
|
2021-10-13 05:14:04 +00:00
|
|
|
|
2022-10-07 22:58:57 +00:00
|
|
|
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx-bin
|
|
|
|
FROM docker:${DOCKER_VERSION}
|
2021-01-10 22:47:55 +00:00
|
|
|
|
2022-11-23 14:01:45 +00:00
|
|
|
RUN apk --update --no-cache add coredns
|
|
|
|
|
|
|
|
COPY --from=build /src/Corefile /etc/coredns/Corefile
|
2022-10-07 22:58:57 +00:00
|
|
|
COPY --from=buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx
|
|
|
|
COPY --from=build /src/plugin-docker-buildx /bin/plugin-docker-buildx
|
2021-02-15 19:18:31 +00:00
|
|
|
|
2021-01-10 22:47:55 +00:00
|
|
|
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
|
|
|
|
2022-10-07 22:58:57 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "plugin-docker-buildx"]
|