3
3
FROM us-east1-docker.pkg.dev/crl-docker-sync/docker-io/library/ubuntu:focal
4
4
ARG TARGETPLATFORM
5
5
6
+ SHELL ["/usr/bin/bash" , "-c" ]
7
+
6
8
RUN apt-get update \
7
9
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
8
10
apt-transport-https \
@@ -39,14 +41,27 @@ RUN apt-get update \
39
41
# c-deps/*-rebuild to force recreating the makefiles. This prevents
40
42
# strange build errors caused by those makefiles depending on the
41
43
# installed version of cmake.
42
- RUN case ${TARGETPLATFORM} in \
44
+ RUN if [[ ${TARGETPLATFORM} == "linux/s390x" ]] ; then \
45
+ curl -fsSL "https://github.com/Kitware/CMake/archive/refs/tags/v3.20.3.tar.gz" -o cmake.tar.gz \
46
+ && echo "aa059c7f89b56215301f1baac8f88a70a67a334495c9ab6a728b97e1defab763 cmake.tar.gz" | sha256sum -c - \
47
+ && tar -xzf cmake.tar.gz \
48
+ && cd CMake-3.20.3 \
49
+ && ./bootstrap -- -DCMAKE_USE_OPENSSL=OFF \
50
+ && make \
51
+ && make install \
52
+ && cd .. \
53
+ && rm -rf CMake-3.20.3 \
54
+ && rm cmake.tar.gz ; \
55
+ else \
56
+ case ${TARGETPLATFORM} in \
43
57
"linux/amd64" ) ARCH=x86_64; SHASUM=97bf730372f9900b2dfb9206fccbcf92f5c7f3b502148b832e77451aa0f9e0e6 ;; \
44
58
"linux/arm64" ) ARCH=aarch64; SHASUM=77620f99e9d5f39cf4a49294c6a68c89a978ecef144894618974b9958efe3c2a ;; \
45
59
esac \
46
- && curl -fsSL "https://github.com/Kitware/CMake/releases/download/v3.20.3/cmake-3.20.3-linux-$ARCH.tar.gz" -o cmake.tar.gz \
47
- && echo "$SHASUM cmake.tar.gz" | sha256sum -c - \
48
- && tar --strip-components=1 -C /usr -xzf cmake.tar.gz \
49
- && rm cmake.tar.gz
60
+ && curl -fsSL "https://github.com/Kitware/CMake/releases/download/v3.20.3/cmake-3.20.3-linux-$ARCH.tar.gz" -o cmake.tar.gz \
61
+ && echo "$SHASUM cmake.tar.gz" | sha256sum -c - \
62
+ && tar --strip-components=1 -C /usr -xzf cmake.tar.gz \
63
+ && rm cmake.tar.gz ; \
64
+ fi
50
65
51
66
# git - Upgrade to a more modern version
52
67
RUN apt-get update && \
@@ -62,16 +77,39 @@ RUN apt-get update && \
62
77
cd .. && \
63
78
rm -rf git-2.29.2.zip git-2.29.2
64
79
65
- RUN curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
66
- && echo 'deb https://packages.cloud.google.com/apt cloud-sdk main' | tee /etc/apt/sources.list.d/gcloud.list \
67
- && curl -fsLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | apt-key add - \
80
+ # NB: Don't install the azure CLI on s390x which doesn't support it.
81
+ RUN if [[ ${TARGETPLATFORM} != "linux/s390x" ]]; then \
82
+ curl -fsLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | apt-key add - \
68
83
&& echo "deb https://packages.microsoft.com/repos/azure-cli/ focal main" > /etc/apt/sources.list.d/azure-cli.list \
69
84
&& apt-get update \
70
- && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
71
- azure-cli \
72
- google-cloud-sdk \
73
- google-cloud-cli-gke-gcloud-auth-plugin \
74
- && apt-get clean
85
+ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends azure-cli \
86
+ && apt-get clean ; \
87
+ fi
88
+
89
+ # NB: As above, this is not available on `s390x`.
90
+ RUN if [[ ${TARGETPLATFORM} != "linux/s390x" ]]; then \
91
+ case ${TARGETPLATFORM} in \
92
+ "linux/amd64" ) ARCH=x86_64; SHASUM= ;; \
93
+ "linux/arm64" ) ARCH=arm; SHASUM=e6153461e3154ebce61d35b73005bdd14a0ecacd42e5008f66e25b4ad231e5c9 ;; \
94
+ esac \
95
+ && curl -fsSL "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-$ARCH.tar.gz" -o gcloud.tar.gz \
96
+ && tar -xzf gcloud.tar.gz \
97
+ && rm gcloud.tar.gz ; \
98
+ fi
99
+
100
+ ENV PATH="$PATH:/google-cloud-sdk/bin"
101
+
102
+ # NB: We're going to run `dev` builds inside the Docker image on `s390x`,
103
+ # as we can't cross-compile them (there are no cross-toolchains for `s390x`
104
+ # hosts. This means we need these extra dependencies installed specifically
105
+ # on that platform. Don't install them on other platforms to avoid taking
106
+ # unintended dependencies on them.
107
+ RUN if [[ ${TARGETPLATFORM} == "linux/s390x" ]]; then \
108
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
109
+ keyutils \
110
+ libresolv-wrapper \
111
+ && apt-get clean ; \
112
+ fi
75
113
76
114
RUN apt-get purge -y \
77
115
apt-transport-https \
@@ -81,19 +119,23 @@ RUN apt-get purge -y \
81
119
82
120
# awscli - roachtests
83
121
# NB: we don't use apt-get because we need an up to date version of awscli
84
- RUN case ${TARGETPLATFORM} in \
122
+ # NB: Don't install these SDK's that are unavailable for s390x.
123
+ RUN if [[ ${TARGETPLATFORM} != "linux/s390x" ]]; then \
124
+ case ${TARGETPLATFORM} in \
85
125
"linux/amd64" ) ARCH=x86_64; SHASUM=e679933eec90b0e5a75d485be6c2fae0f89a3f9ccdcb1748be69f8f456e9a85f ;; \
86
126
"linux/arm64" ) ARCH=aarch64; SHASUM=7d6460f795712ebdac7e3c60d4800dde682d136d909810402aac164f2789b860 ;; \
87
- esac && \
88
- curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH-2.13.9.zip" -o "awscliv2.zip" && \
89
- echo "$SHASUM awscliv2.zip" | sha256sum -c - && \
90
- unzip awscliv2.zip && \
91
- ./aws/install && \
92
- rm -rf aws awscliv2.zip
127
+ esac \
128
+ && curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH-2.13.9.zip" -o "awscliv2.zip" \
129
+ && echo "$SHASUM awscliv2.zip" | sha256sum -c - \
130
+ && unzip awscliv2.zip \
131
+ && ./aws/install \
132
+ && rm -rf aws awscliv2.zip ; \
133
+ fi
93
134
94
135
RUN case ${TARGETPLATFORM} in \
95
136
"linux/amd64" ) ARCH=x86_64; SHASUM=a3fb9c1de3512bc91f27cc47297d6d6cf208adee9b64ed719130da59ac13e26b ;; \
96
137
"linux/arm64" ) ARCH=aarch64; SHASUM=e5165eb592a317e1f6da0ac7fcbccf60d7fb8e5ac1f0d7336a9be51c23308b06 ;; \
138
+ "linux/s390x" ) ARCH=s390x; SHASUM=4969ae702488cb79afd14bf91c10b496996852b82a364907c1ebfa5f1667a139 ;; \
97
139
esac && \
98
140
curl -fsSL "https://github.com/NixOS/patchelf/releases/download/0.17.2/patchelf-0.17.2-$ARCH.tar.gz" -o "patchelf.tar.gz" && \
99
141
echo "$SHASUM patchelf.tar.gz" | sha256sum -c - && \
@@ -105,10 +147,11 @@ RUN case ${TARGETPLATFORM} in \
105
147
# build/bootstrap/bootstrap-debian.sh -- if an update is necessary here, it's probably
106
148
# necessary in the agent as well.
107
149
RUN case ${TARGETPLATFORM} in \
108
- "linux/amd64" ) ARCH=amd64; SHASUM=4cb534c52cdd47a6223d4596d530e7c9c785438ab3b0a49ff347e991c210b2cd ;; \
109
- "linux/arm64" ) ARCH=arm64; SHASUM=c1de6860dd4f8d5e2ec270097bd46d6a211b971a0b8b38559784bd051ea950a1 ;; \
150
+ "linux/amd64" ) ARCH=amd64; SHASUM=84916c44c8d81cb64f6c9a9f8fd8fa059342e872bfc1ce185f5dcbf70c6aadea ;; \
151
+ "linux/arm64" ) ARCH=arm64; SHASUM=7937c941e5140a6a22f6b84919e561b9b77ec49e307852ed0b3cc2a45beace9e ;; \
152
+ "linux/s390x" ) ARCH=s390x; SHASUM=df7a5cfe632da022bb2cdc51824e8b04634d86d3ad4a24610c4da758c2e5708f ;; \
110
153
esac \
111
- && curl -fsSL "https://github.com/bazelbuild /bazelisk/releases/download/v1.10.1 /bazelisk-linux-$ARCH" > /tmp/bazelisk \
154
+ && curl -fsSL "https://github.com/cockroachdb /bazelisk/releases/download/2025-07-14 /bazelisk-linux-$ARCH" > /tmp/bazelisk \
112
155
&& echo "$SHASUM /tmp/bazelisk" | sha256sum -c - \
113
156
&& chmod +x /tmp/bazelisk \
114
157
&& mv /tmp/bazelisk /usr/bin/bazel
@@ -119,14 +162,26 @@ RUN ln -sf /usr/bin/llvm-nm /usr/bin/nm
119
162
120
163
RUN rm -rf /tmp/* /var/lib/apt/lists/*
121
164
122
- RUN case ${TARGETPLATFORM} in \
165
+ RUN if [[ ${TARGETPLATFORM} == "linux/s390x" ]]; then \
166
+ curl -fsSL "https://github.com/benesch/autouseradd/archive/refs/tags/1.3.0.tar.gz" -o autouseradd.tar.gz \
167
+ && echo "da70cbb00878ab395276b0f6191815a763bc8aa2fc120fb36580f6313de4c41f autouseradd.tar.gz" | sha256sum -c - \
168
+ && tar -xzf autouseradd.tar.gz \
169
+ && cd autouseradd-1.3.0 \
170
+ && make \
171
+ && make install \
172
+ && cd .. \
173
+ && rm -rf autouseradd-1.3.0 \
174
+ && rm autouseradd.tar.gz ; \
175
+ else \
176
+ case ${TARGETPLATFORM} in \
123
177
"linux/amd64" ) ARCH=amd64; SHASUM=442dae58b727a79f81368127fac141d7f95501ffa05f8c48943d27c4e807deb7 ;; \
124
178
"linux/arm64" ) ARCH=arm64; SHASUM=b216bebfbe30c3c156144cff07233654e23025e26ab5827058c9b284e130599e ;; \
125
179
esac \
126
180
&& curl -fsSL "https://github.com/benesch/autouseradd/releases/download/1.3.0/autouseradd-1.3.0-$ARCH.tar.gz" -o autouseradd.tar.gz \
127
181
&& echo "$SHASUM autouseradd.tar.gz" | sha256sum -c - \
128
182
&& tar xzf autouseradd.tar.gz --strip-components 1 \
129
- && rm autouseradd.tar.gz
183
+ && rm autouseradd.tar.gz ; \
184
+ fi
130
185
131
186
ENTRYPOINT ["autouseradd" , "--user" , "roach" , "--no-create-home" ]
132
187
CMD ["/usr/bin/bash" ]
0 commit comments