@@ -61,6 +61,7 @@ ENV DEBIAN_FRONTEND=noninteractive
6161RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
6262 make \
6363 git \
64+ jq \
6465 curl \
6566 dpkg-dev
6667ARG TARGETARCH
@@ -75,6 +76,7 @@ RUN xx-apt-get update -qq && xx-apt-get install -qq --no-install-recommends \
7576 pkg-config
7677RUN git config --global advice.detachedHead false
7778ADD hack/git-checkout-tag-with-hash.sh /usr/local/bin/
79+ ADD hack/scripts/lib.sh /usr/local/bin/http::helper
7880
7981FROM build-base AS build-containerd
8082ARG TARGETARCH
@@ -174,10 +176,11 @@ RUN cd /out/lib/systemd/system && \
174176 echo "" >> buildkit.service && \
175177 echo "# This file was converted from containerd.service, with \` sed -E '${sedcomm}'\` " >> buildkit.service
176178ARG STARGZ_SNAPSHOTTER_VERSION
177- RUN STARGZ_SNAPSHOTTER_VERSION=${STARGZ_SNAPSHOTTER_VERSION%%@*}; \
179+ RUN --mount=type=secret,id=github_token,env=GITHUB_TOKEN \
180+ STARGZ_SNAPSHOTTER_VERSION=${STARGZ_SNAPSHOTTER_VERSION%%@*}; \
178181 fname="stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
179182 curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/containerd/stargz-snapshotter/releases/download/${STARGZ_SNAPSHOTTER_VERSION}/${fname}" && \
180- curl -o "stargz-snapshotter.service" -fsSL --proto '=https' --tlsv1.2 "https://raw.githubusercontent.com/ containerd/stargz-snapshotter/${STARGZ_SNAPSHOTTER_VERSION}/ script/config/etc/systemd/system/stargz-snapshotter.service" && \
183+ http::helper github::file containerd/stargz-snapshotter script/config/etc/systemd/system/stargz-snapshotter.service "${STARGZ_SNAPSHOTTER_VERSION}" > " stargz-snapshotter.service" && \
181184 grep "${fname}" "/SHA256SUMS.d/stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}" | sha256sum -c - && \
182185 grep "stargz-snapshotter.service" "/SHA256SUMS.d/stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}" | sha256sum -c - && \
183186 tar xzf "${fname}" -C /out/bin && \
@@ -245,6 +248,10 @@ RUN ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION%%@*}; \
245248ARG GOMODJAIL_VERSION
246249COPY --from=build-gomodjail /out/${TARGETARCH:-amd64}/* /out/bin/
247250RUN echo "- gomodjail: ${GOMODJAIL_VERSION}" >> /out/share/doc/nerdctl-full/README.md
251+ ARG CONTAINERIZED_SYSTEMD_VERSION
252+ RUN --mount=type=secret,id=github_token,env=GITHUB_TOKEN \
253+ http::helper github::file AkihiroSuda/containerized-systemd docker-entrypoint.sh "${CONTAINERIZED_SYSTEMD_VERSION}" > /docker-entrypoint.sh && \
254+ chmod +x /docker-entrypoint.sh
248255
249256RUN echo "" >> /out/share/doc/nerdctl-full/README.md && \
250257 echo "## License" >> /out/share/doc/nerdctl-full/README.md && \
@@ -281,9 +288,7 @@ RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
281288 iproute2 iptables \
282289 dbus dbus-user-session systemd systemd-sysv \
283290 fuse3
284- ARG CONTAINERIZED_SYSTEMD_VERSION
285- RUN curl -o /docker-entrypoint.sh -fsSL --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/AkihiroSuda/containerized-systemd/${CONTAINERIZED_SYSTEMD_VERSION}/docker-entrypoint.sh && \
286- chmod +x /docker-entrypoint.sh
291+ COPY --from=build-full /docker-entrypoint.sh /docker-entrypoint.sh
287292COPY --from=out-full / /usr/local/
288293RUN perl -pi -e 's/multi-user.target/docker-entrypoint.target/g' /usr/local/lib/systemd/system/*.service && \
289294 systemctl enable containerd buildkit stargz-snapshotter && \
0 commit comments