@@ -55,11 +55,13 @@ ARG KUBO_VERSION=v0.34.1
55
55
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1@sha256:923441d7c25f1e2eb5789f82d987693c47b8ed987c4ab3b075d6ed2b5d6779a3 AS xx
56
56
57
57
58
- FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS build-base-debian
58
+ FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS build-base
59
59
COPY --from=xx / /
60
60
ENV DEBIAN_FRONTEND=noninteractive
61
61
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
62
+ make \
62
63
git \
64
+ curl \
63
65
dpkg-dev
64
66
ARG TARGETARCH
65
67
# libbtrfs: for containerd
@@ -74,7 +76,7 @@ RUN xx-apt-get update -qq && xx-apt-get install -qq --no-install-recommends \
74
76
RUN git config --global advice.detachedHead false
75
77
ADD hack/git-checkout-tag-with-hash.sh /usr/local/bin/
76
78
77
- FROM build-base-debian AS build-containerd
79
+ FROM build-base AS build-containerd
78
80
ARG TARGETARCH
79
81
ARG CONTAINERD_VERSION
80
82
RUN git clone --quiet --depth 1 --branch "${CONTAINERD_VERSION%@*}" https://github.com/containerd/containerd.git /go/src/github.com/containerd/containerd
@@ -85,7 +87,7 @@ RUN git-checkout-tag-with-hash.sh ${CONTAINERD_VERSION} && \
85
87
RUN GO=xx-go make STATIC=1 && \
86
88
cp -a bin/containerd bin/containerd-shim-runc-v2 bin/ctr /out/$TARGETARCH
87
89
88
- FROM build-base-debian AS build-runc
90
+ FROM build-base AS build-runc
89
91
ARG RUNC_VERSION
90
92
ARG TARGETARCH
91
93
RUN git clone --quiet --depth 1 --branch "${RUNC_VERSION%@*}" https://github.com/opencontainers/runc.git /go/src/github.com/opencontainers/runc
@@ -96,7 +98,7 @@ ENV CGO_ENABLED=1
96
98
RUN GO=xx-go CC=$(xx-info)-gcc STRIP=$(xx-info)-strip make static && \
97
99
xx-verify --static runc && cp -v -a runc /out/runc.${TARGETARCH}
98
100
99
- FROM build-base-debian AS build-bypass4netns
101
+ FROM build-base AS build-bypass4netns
100
102
ARG BYPASS4NETNS_VERSION
101
103
ARG TARGETARCH
102
104
RUN git clone --quiet --depth 1 --branch "${BYPASS4NETNS_VERSION%@*}" https://github.com/rootless-containers/bypass4netns.git /go/src/github.com/rootless-containers/bypass4netns
@@ -107,7 +109,7 @@ ENV CGO_ENABLED=1
107
109
RUN GO=xx-go make static && \
108
110
xx-verify --static bypass4netns && cp -a bypass4netns bypass4netnsd /out/${TARGETARCH}
109
111
110
- FROM build-base-debian AS build-gomodjail
112
+ FROM build-base AS build-gomodjail
111
113
ARG GOMODJAIL_VERSION
112
114
ARG TARGETARCH
113
115
RUN git clone --quiet --depth 1 --branch "${GOMODJAIL_VERSION%@*}" https://github.com/AkihiroSuda/gomodjail.git /go/src/github.com/AkihiroSuda/gomodjail
@@ -117,7 +119,7 @@ RUN git-checkout-tag-with-hash.sh ${GOMODJAIL_VERSION} && \
117
119
RUN GO=xx-go make STATIC=1 && \
118
120
xx-verify --static _output/bin/gomodjail && cp -a _output/bin/gomodjail /out/${TARGETARCH}
119
121
120
- FROM build-base-debian AS build-kubo
122
+ FROM build-base AS build-kubo
121
123
ARG KUBO_VERSION
122
124
ARG TARGETARCH
123
125
RUN git clone --quiet --depth 1 --branch "${KUBO_VERSION%@*}" https://github.com/ipfs/kubo.git /go/src/github.com/ipfs/kubo
@@ -129,11 +131,6 @@ RUN xx-go --wrap && \
129
131
make build && \
130
132
xx-verify --static cmd/ipfs/ipfs && cp -a cmd/ipfs/ipfs /out/${TARGETARCH}
131
133
132
- FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS build-base
133
- RUN apk add --no-cache make git curl
134
- RUN git config --global advice.detachedHead false
135
- ADD hack/git-checkout-tag-with-hash.sh /usr/local/bin/
136
-
137
134
FROM build-base AS build-minimal
138
135
RUN BINDIR=/out/bin make binaries install
139
136
# We do not set CMD to `go test` here, because it requires systemd
@@ -310,7 +307,7 @@ RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
310
307
git \
311
308
make
312
309
# We wouldn't need this if Docker Hub could have "golang:${GO_VERSION}-ubuntu"
313
- COPY --from=build-base-debian /usr/local/go /usr/local/go
310
+ COPY --from=build-base /usr/local/go /usr/local/go
314
311
ARG TARGETARCH
315
312
ENV PATH=/usr/local/go/bin:$PATH
316
313
ARG GOTESTSUM_VERSION
0 commit comments