@@ -67,15 +67,6 @@ RUN --mount=from=runc-src,src=/usr/src/runc,target=. --mount=target=/root/.cache
6767 CGO_ENABLED=1 xx-go build -mod=vendor -ldflags '-extldflags -static' -tags 'apparmor seccomp netgo cgo static_build osusergo' -o /usr/bin/runc ./ && \
6868 xx-verify --static /usr/bin/runc
6969
70- # dnsname CNI plugin for testing
71- FROM gobuild-base AS dnsname
72- ARG DNSNAME_VERSION
73- WORKDIR /go/dnsname
74- RUN git clone https://github.com/containers/dnsname.git . \
75- && git checkout -q "$DNSNAME_VERSION"
76- RUN --mount=target=/root/.cache,type=cache \
77- set -e; make binaries; mv bin/dnsname /usr/bin/dnsname
78-
7970FROM gobuild-base AS buildkit-base
8071WORKDIR /src
8172ENV GOFLAGS=-mod=vendor
@@ -225,6 +216,22 @@ FROM binaries AS buildkit-windows
225216# this is not in binaries-windows because it is not intended for release yet, just CI
226217COPY --link --from=buildkitd /usr/bin/buildkitd /buildkitd.exe
227218
219+ # dnsname source
220+ FROM git AS dnsname-src
221+ ARG DNSNAME_VERSION
222+ WORKDIR /usr/src
223+ RUN git clone https://github.com/containers/dnsname.git dnsname \
224+ && cd dnsname && git checkout -q "$DNSNAME_VERSION"
225+
226+ # build dnsname CNI plugin for testing
227+ FROM gobuild-base AS dnsname
228+ WORKDIR /go/src/github.com/containers/dnsname
229+ ARG TARGETPLATFORM
230+ RUN --mount=from=dnsname-src,src=/usr/src/dnsname,target=.,rw \
231+ --mount=target=/root/.cache,type=cache \
232+ CGO_ENABLED=0 xx-go build -o /usr/bin/dnsname ./plugins/meta/dnsname && \
233+ xx-verify --static /usr/bin/dnsname
234+
228235FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS cni-plugins
229236RUN apk add --no-cache curl
230237ARG CNI_VERSION
0 commit comments