@@ -107,6 +107,16 @@ ENV CGO_ENABLED=1
107
107
RUN GO=xx-go make static && \
108
108
xx-verify --static bypass4netns && cp -a bypass4netns bypass4netnsd /out/${TARGETARCH}
109
109
110
+ FROM build-base-debian AS build-gomodjail
111
+ ARG GOMODJAIL_VERSION
112
+ ARG TARGETARCH
113
+ RUN git clone --quiet --depth 1 --branch "${GOMODJAIL_VERSION%@*}" https://github.com/AkihiroSuda/gomodjail.git /go/src/github.com/AkihiroSuda/gomodjail
114
+ WORKDIR /go/src/github.com/AkihiroSuda/gomodjail
115
+ RUN git-checkout-tag-with-hash.sh ${GOMODJAIL_VERSION} && \
116
+ mkdir -p /out/${TARGETARCH}
117
+ RUN GO=xx-go make STATIC=1 && \
118
+ xx-verify --static _output/bin/gomodjail && cp -a _output/bin/gomodjail /out/${TARGETARCH}
119
+
110
120
FROM build-base-debian AS build-kubo
111
121
ARG KUBO_VERSION
112
122
ARG TARGETARCH
@@ -234,12 +244,8 @@ RUN ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION/@BINARY}; \
234
244
rm -f "${fname}" /out/bin/rootlesskit-docker-proxy && \
235
245
echo "- RootlessKit: ${ROOTLESSKIT_VERSION}" >> /out/share/doc/nerdctl-full/README.md
236
246
ARG GOMODJAIL_VERSION
237
- RUN git clone https://github.com/AkihiroSuda/gomodjail.git /go/src/github.com/AkihiroSuda/gomodjail && \
238
- cd /go/src/github.com/AkihiroSuda/gomodjail && \
239
- git-checkout-tag-with-hash.sh "${GOMODJAIL_VERSION}" && \
240
- make STATIC=1 && \
241
- cp -a _output/bin/gomodjail /out/bin/ && \
242
- echo "- gomodjail: ${GOMODJAIL_VERSION}" >> /out/share/doc/nerdctl-full/README.md
247
+ COPY --from=build-gomodjail /out/${TARGETARCH:-amd64}/* /out/bin/
248
+ RUN echo "- gomodjail: ${GOMODJAIL_VERSION}" >> /out/share/doc/nerdctl-full/README.md
243
249
244
250
RUN echo "" >> /out/share/doc/nerdctl-full/README.md && \
245
251
echo "## License" >> /out/share/doc/nerdctl-full/README.md && \
@@ -254,6 +260,8 @@ COPY . /go/src/github.com/containerd/nerdctl
254
260
RUN { echo "# nerdctl (full distribution)" ; echo "- nerdctl: $(cd /go/src/github.com/containerd/nerdctl && git describe --tags)" ; cat /out/share/doc/nerdctl-full/README.md; } > /out/share/doc/nerdctl-full/README.md.new; mv /out/share/doc/nerdctl-full/README.md.new /out/share/doc/nerdctl-full/README.md
255
261
WORKDIR /go/src/github.com/containerd/nerdctl
256
262
RUN BINDIR=/out/bin make binaries install
263
+ # FIXME: `gomodjail pack` depends on QEMU for non-native architecture
264
+ # TODO: gomodjail should provide a plain shell script that utilizes `zip(1)` for packing the self-extract archive, without running `gomodjail pack`..
257
265
RUN /out/bin/gomodjail pack --go-mod=/go/src/github.com/containerd/nerdctl/go.mod /out/bin/nerdctl && \
258
266
cp -a nerdctl.gomodjail /out/bin/
259
267
COPY README.md /out/share/doc/nerdctl/
0 commit comments