Skip to content

Commit 3ebdc60

Browse files
committed
chore: modernize Dockerfile and document glibc floor
1 parent 71011ec commit 3ebdc60

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

Dockerfile

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
# Pinned intentionally. Do NOT bump the base image without revisiting
2+
# build-go.sh's glibc-check assertion (`minor < 32`). Ubuntu 20.04 ships
3+
# glibc 2.31, which caps CGO-linked linux/amd64 binaries at GLIBC_2.31
4+
# symbols, keeping dist.ipfs.tech tarballs runnable on CentOS 7/RHEL 7,
5+
# RHEL 8/9, Ubuntu 18.04/20.04, and Debian 10/11. Upgrading the base
6+
# image is a user-facing compat break and must be announced in release
7+
# notes. Revisit by 2026-08 (Debian 11 LTS EOL) to pick the next floor.
18
FROM ubuntu:20.04
29

3-
ENV DEBIAN_FRONTEND noninteractive
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
ENV TZ=Etc/UTC
412
ARG USER_UID
513

614
ARG KUBO_VER
7-
RUN apt-get update -q && apt-get install -y git curl gnupg jq build-essential gawk zip tzdata && \
8-
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
9-
dpkg-reconfigure --frontend noninteractive tzdata
15+
RUN apt-get update -q \
16+
&& apt-get install -y --no-install-recommends \
17+
ca-certificates git curl gnupg jq build-essential gawk zip tzdata \
18+
&& rm -rf /var/lib/apt/lists/*
1019

1120
RUN curl -sS --retry 5 \
1221
"https://dist.ipfs.tech/kubo/${KUBO_VER}/kubo_${KUBO_VER}_linux-amd64.tar.gz" -o /tmp/kubo.tar.gz && \
@@ -18,15 +27,15 @@ RUN curl -sS --retry 5 \
1827
| tar -xz -C /usr/local/bin asdf
1928

2029
RUN adduser --shell /bin/bash --home /asdf --disabled-password --gecos asdf asdf --uid $USER_UID
21-
ENV ASDF_DATA_DIR=/asdf/.asdf
22-
ENV PATH="${PATH}:/asdf/.asdf/shims"
30+
ENV ASDF_DATA_DIR=/asdf/.asdf \
31+
PATH="${PATH}:/asdf/.asdf/shims"
2332

2433
USER asdf
2534
WORKDIR /asdf
2635

27-
RUN asdf plugin add golang
28-
RUN asdf plugin add nodejs
29-
ADD .tool-versions .
36+
RUN asdf plugin add golang \
37+
&& asdf plugin add nodejs
38+
COPY .tool-versions .
3039

3140
RUN asdf install
3241

@@ -37,7 +46,8 @@ RUN go install github.com/guseggert/glibc-check/cmd/glibc-check@v0.0.0-202111301
3746

3847
ARG CACHEBUST=undefined
3948
USER root
40-
RUN apt-get update && apt-get -y upgrade
49+
RUN apt-get update && apt-get -y upgrade \
50+
&& rm -rf /var/lib/apt/lists/*
4151

4252
USER asdf
4353
WORKDIR /build

build-go.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ function goBuild() {
115115
return 1
116116
fi
117117

118+
# Enforce the glibc ABI floor: linux/amd64 tarballs published to
119+
# dist.ipfs.tech must not require glibc symbols newer than GLIBC_2.31,
120+
# so they keep running on hosts as old as CentOS 7-era glibc (~2.14).
121+
# The Dockerfile is pinned to ubuntu:20.04 (glibc 2.31) to bound this;
122+
# raising the base image without raising this assertion breaks users.
118123
if [ -x "$(which glibc-check)" ] && [ "$GOOS" == "linux" ] && [ "$GOARCH" == "amd64" ]; then
119124
echo "GLIBC versions:"
120125
glibc-check list-versions "$output"

0 commit comments

Comments
 (0)