@@ -14,6 +14,23 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
14
14
# deb [arch=amd64] http://ukdebian.mirror.anlx.net/debian buster main non-free contrib\
15
15
# > /etc/apt/sources.list
16
16
17
+ # First install the minimal set of utils that will be used to setup the rest of the packages to install.
18
+ RUN apt-get --yes update && apt-get install --no-install-recommends --yes curl gnupg2 gnupg-agent ca-certificates
19
+
20
+ # Install LLDB for debugging support.
21
+ ARG llvm_version=14
22
+ RUN curl --fail --silent --show-error --location https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
23
+ RUN echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-$llvm_version main" >> /etc/apt/sources.list.d/llvm.list
24
+
25
+ # Install docker CLI.
26
+ RUN curl --fail --silent --show-error --location https://download.docker.com/linux/debian/gpg | apt-key add -
27
+ RUN echo "deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable" > /etc/apt/sources.list.d/backports.list
28
+
29
+ # Install NodeJS
30
+ # https://github.com/nodesource/distributions/blob/master/README.md#manual-installation
31
+ RUN curl --fail --silent --show-error --location https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
32
+ RUN echo "deb https://deb.nodesource.com/node_18.x bullseye main" > /etc/apt/sources.list.d/nodesource.list
33
+
17
34
# Getting curl and certificates dependecies.
18
35
# We're rate-limiting HTTP requests to 500 kB/s as otherwise we may get timeout errors
19
36
# when downloading from snapshot.debian.org.
@@ -22,17 +39,25 @@ RUN apt-get --yes update \
22
39
apt-transport-https \
23
40
build-essential \
24
41
ca-certificates \
42
+ # `chromium` is required to run our tests with wasm-pack.
43
+ chromium \
44
+ chromium-driver \
25
45
clang-format \
26
46
clang-tidy \
47
+ # `cmake` is needed for flatbuffer.
48
+ cmake \
27
49
curl \
50
+ docker-ce-cli \
28
51
git \
29
52
gnupg2 \
30
53
gnupg-agent \
31
54
libcap-dev \
32
55
libfl2 \
33
56
libncurses5 \
34
57
libssl-dev \
58
+ lldb-${llvm_version} \
35
59
musl-tools \
60
+ nodejs \
36
61
openjdk-11-jdk \
37
62
pkg-config \
38
63
procps \
@@ -54,23 +79,6 @@ RUN apt-get --yes update \
54
79
&& git --version \
55
80
&& shellcheck --version
56
81
57
- # Add LLDB version 14 for debugging support.
58
- ARG llvm_version=14
59
- RUN echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-$llvm_version main" >> /etc/apt/sources.list.d/llvm.list \
60
- && curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
61
- && apt-get update --yes \
62
- && apt-get install --no-install-recommends --yes \
63
- lldb-${llvm_version} \
64
- && rm --recursive --force /var/lib/apt/lists/*
65
-
66
- # Install a version of docker CLI.
67
- RUN curl --fail --silent --show-error --location https://download.docker.com/linux/debian/gpg | apt-key add -
68
- RUN echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/backports.list \
69
- && apt-get --yes update \
70
- && apt-get install --no-install-recommends --yes docker-ce-cli \
71
- && apt-get clean \
72
- && rm --recursive --force /var/lib/apt/lists/*
73
-
74
82
# Install Ent CLI. We mostly then just use it in order to simplify the logic around fetching
75
83
# artifacts by URL and ensuring that their digest is correct, in order to ensure reproducibility.
76
84
ARG ent_server_url=https://ent-server-62sa4xcfia-ew.a.run.app
@@ -80,8 +88,8 @@ RUN curl --location ${ent_server_url}/raw/${ent_digest} > /usr/local/bin/ent \
80
88
&& ent
81
89
82
90
# Use a fixed version of Bazel.
83
- ARG bazel_version=4.2.0
84
- ARG bazel_digest=sha256:89b14fa0d9ce5637f4e0b66df56a531e1e3c50d88614311334d192531cf1e0fa
91
+ ARG bazel_version=5.3.1
92
+ ARG bazel_digest=sha256:1e939b50d90f68d30fa4f3c12dfdf31429b83ddd8076c622429854f64253c23d
85
93
ARG bazel_url=https://storage.googleapis.com/bazel-apt/pool/jdk1.8/b/bazel/bazel_${bazel_version}_amd64.deb
86
94
RUN ent get ${bazel_digest} --url=${bazel_url} > bazel.deb \
87
95
&& apt-get install --no-install-recommends --yes ./bazel.deb \
@@ -93,34 +101,10 @@ RUN ent get ${bazel_digest} --url=${bazel_url} > bazel.deb \
93
101
# more frequently changed.
94
102
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache.
95
103
96
- # Install Emscripten.
97
- ARG emscripten_version=1.39.17
98
- # Pick compatible Node version by grepping "node" in the emscripten.zip
99
- # Node is needed to expose npm needed for installing Prettier.
100
- ARG emscripten_node_version_directory=12.9.1_64bit
101
- ARG emscripten_digest=sha256:925dd5ca7dd783d0b367386e81847eaf680d54ae86017c4b5846dea951e17dc9
102
-
103
- ARG emscripten_dir=/usr/local/emsdk
104
- ARG emscripten_temp=/tmp/emscripten.zip
105
- RUN mkdir --parents ${emscripten_dir} \
106
- && ent get ${emscripten_digest} --url=https://github.com/emscripten-core/emsdk/archive/${emscripten_version}.tar.gz > ${emscripten_temp} \
107
- && tar --extract --gzip --file=${emscripten_temp} --directory=${emscripten_dir} --strip-components=1 \
108
- && rm ${emscripten_temp} \
109
- && ${emscripten_dir}/emsdk install ${emscripten_version} \
110
- && ${emscripten_dir}/emsdk activate --embedded ${emscripten_version}
111
- ENV EMSDK "${emscripten_dir}"
112
- ENV EM_CONFIG "${emscripten_dir}/.emscripten"
113
- ENV EM_CACHE "${emscripten_dir}/.emscripten_cache"
114
- ENV PATH "${emscripten_dir}:${emscripten_dir}/node/${emscripten_node_version_directory}/bin:${PATH}"
115
- # We need to allow a non-root Docker container to write into the directory
116
- RUN chmod --recursive go+wx "${emscripten_dir}"
117
- # Emscripten brings Node with it, we need to allow non-root access to temp and
118
- # config folders
119
- RUN mkdir -p "/.npm" && chmod a+rwx "/.npm" & mkdir -p "/.config" && chmod a+rwx "/.config"
120
-
121
104
# Install Go.
122
- ARG golang_version=1.17.7
123
- ARG golang_digest=sha256:02b111284bedbfa35a7e5b74a06082d18632eff824fd144312f6063943d49259
105
+ # https://go.dev/dl/
106
+ ARG golang_version=1.19.2
107
+ ARG golang_digest=sha256:5e8c5a74fe6470dd7e055a461acda8bb4050ead8c2df70f227e3ff7d8eb7eeb6
124
108
ARG golang_temp=/tmp/golang.tar.gz
125
109
ENV GOROOT /usr/local/go
126
110
ENV GOPATH ${HOME}/go
@@ -138,21 +122,22 @@ RUN mkdir --parents ${GOROOT} \
138
122
139
123
# Install embedmd (Markdown snippet embedder) (via Go).
140
124
# https://github.com/campoy/embedmd
141
- RUN go get github.com/campoy/embedmd@97c13d6 \
125
+ RUN go install github.com/campoy/embedmd@97c13d6 \
142
126
&& embedmd -v
143
127
144
128
# Install liche (Markdown link checker) (via Go).
145
129
# https://github.com/raviqqe/liche
146
- RUN go get github.com/raviqqe/liche@f9ba5f2 \
130
+ RUN go install github.com/raviqqe/liche@f9ba5f2 \
147
131
&& liche --version
148
132
149
133
# Install prettier and markdownlint (via Node.js).
150
134
# This will use the Node version installed by emscripten.
151
135
# https://prettier.io/
136
+ # https://github.com/prettier/prettier
152
137
# https://github.com/igorshubovych/markdownlint-cli
153
- ARG prettier_version=2.5 .1
138
+ ARG prettier_version=2.7 .1
154
139
ARG prettier_plugin_toml_version=0.3.1
155
- ARG markdownlint_version=0.30.0
140
+ ARG markdownlint_version=0.32.2
156
141
RUN npm install --global \
157
142
prettier@${prettier_version} \
158
143
prettier-plugin-toml@${prettier_plugin_toml_version} \
@@ -162,8 +147,8 @@ RUN npm install --global \
162
147
163
148
# Install hadolint.
164
149
# https://github.com/hadolint/hadolint
165
- ARG hadolint_version=2.8 .0
166
- ARG hadolint_digest=sha256:9dfc155139a1e1e9b3b28f3de9907736b9dfe7cead1c3a0ae7ff0158f3191674
150
+ ARG hadolint_version=2.10 .0
151
+ ARG hadolint_digest=sha256:8ee6ff537341681f9e91bae2d5da451b15c575691e33980893732d866d3cefc4
167
152
ARG hadolint_dir=/usr/local/hadolint/bin
168
153
ARG hadolint_bin=${hadolint_dir}/hadolint
169
154
ENV PATH "${hadolint_dir}:${PATH}"
@@ -174,8 +159,8 @@ RUN mkdir --parents ${hadolint_dir} \
174
159
175
160
# Install buildifier.
176
161
# https://github.com/bazelbuild/buildtools/tree/master/buildifier
177
- ARG bazel_tools_version=5.0 .0
178
- ARG buildifier_digest=sha256:18a518a4b9b83bb96a115a681099ae6c115217e925a2dacfb263089e3a791b5d
162
+ ARG bazel_tools_version=5.1 .0
163
+ ARG buildifier_digest=sha256:52bf6b102cb4f88464e197caac06d69793fa2b05f5ad50a7e7bf6fbd656648a3
179
164
ARG buildifier_dir=/usr/local/buildifier/bin
180
165
ARG buildifier_bin=${buildifier_dir}/buildifier
181
166
ENV PATH "${buildifier_dir}:${PATH}"
@@ -185,8 +170,9 @@ RUN mkdir --parents ${buildifier_dir} \
185
170
&& buildifier --version
186
171
187
172
# Install Protobuf compiler.
188
- ARG protobuf_version=3.19.4
189
- ARG protobuf_digest=sha256:058d29255a08f8661c8096c92961f3676218704cbd516d3916ec468e139cbd87
173
+ # https://github.com/protocolbuffers/protobuf
174
+ ARG protobuf_version=3.20.3
175
+ ARG protobuf_digest=sha256:44a6b498e996b845edef83864734c0e52f42197e85c9d567af55f4e3ff09d755
190
176
ARG protobuf_dir=/usr/local/protobuf
191
177
ARG protobuf_temp=/tmp/protobuf.zip
192
178
ENV PATH "${protobuf_dir}/bin:${PATH}"
@@ -251,7 +237,12 @@ RUN cargo install --version=${wizer_version} wizer --all-features
251
237
252
238
# Install crosvm.
253
239
# We're not interested in most of the features in crosvm (e.g. wayland support), but GDB support would be nice.
254
- RUN cargo install --git https://chromium.googlesource.com/chromiumos/platform/crosvm/ --rev 31f04e92709980a4ffc56b1631f8b4be437cc2fe crosvm --no-default-features --features gdb
240
+ RUN cargo install \
241
+ --git=https://chromium.googlesource.com/chromiumos/platform/crosvm/ \
242
+ --rev=31f04e92709980a4ffc56b1631f8b4be437cc2fe \
243
+ crosvm \
244
+ --no-default-features \
245
+ --features=gdb
255
246
256
247
# Where to install rust tooling
257
248
ARG install_dir=${rustup_dir}/bin
@@ -296,25 +287,6 @@ RUN chmod +x ${install_dir}/rust-analyzer
296
287
# its own home folder.
297
288
ENV CARGO_HOME ""
298
289
299
- # Build a statically-linked version of OpenSSL with musl
300
- ENV OPENSSL_DIR /musl
301
- RUN mkdir ${OPENSSL_DIR}
302
-
303
- RUN ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm
304
- RUN ln -s /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic
305
- RUN ln -s /usr/include/linux /usr/include/x86_64-linux-musl/linux
306
-
307
- ARG openssl_dir=/usr/local/openssl
308
- RUN mkdir --parents ${openssl_dir}
309
- RUN curl --location https://github.com/openssl/openssl/archive/OpenSSL_1_1_1f.tar.gz | tar --extract --gzip --directory=${openssl_dir}/
310
- WORKDIR ${openssl_dir}/openssl-OpenSSL_1_1_1f
311
- RUN CC="musl-gcc -fPIE -pie" ./Configure no-shared no-async --prefix=/musl --openssldir="${OPENSSL_DIR}/ssl" linux-x86_64
312
- RUN make depend && make -j"$(nproc)" && make install_sw install_ssldirs
313
-
314
- # Allow the build to find statically built OpenSSL.
315
- ENV PKG_CONFIG_ALLOW_CROSS 1
316
- ENV OPENSSL_STATIC 1
317
-
318
290
# Install sccache
319
291
# https://github.com/mozilla/sccache
320
292
ARG sccache_version=v0.2.15
@@ -333,12 +305,6 @@ RUN mkdir --parents ${sccache_dir} \
333
305
# Ref:https://chromium.googlesource.com/external/github.com/google/flatbuffers/+/750dde766990d75f849370582a0f90307c410537
334
306
ARG flatc_commit=750dde766990d75f849370582a0f90307c410537
335
307
ARG flatbuffer_tmp_dir=/tmp/flatbuffer
336
- # cmake is required to build flatbuffer
337
- RUN apt-get --yes update \
338
- && apt-get install --no-install-recommends --yes --option Acquire::http::Dl-Limit=500 \
339
- cmake \
340
- && apt-get clean \
341
- && rm --recursive --force /var/lib/apt/lists/*
342
308
RUN git clone https://github.com/google/flatbuffers.git ${flatbuffer_tmp_dir}
343
309
WORKDIR ${flatbuffer_tmp_dir}
344
310
RUN git checkout ${flatc_commit} \
@@ -364,20 +330,52 @@ RUN mkdir --parents ${wasm_pack_dir} \
364
330
&& chmod +x ${wasm_pack_bin} \
365
331
&& wasm-pack --version
366
332
367
- # chromium is required to run our tests with wasm-pack
368
- RUN apt-get --yes update \
369
- && apt-get install --no-install-recommends --yes --option Acquire::http::Dl-Limit=500 \
370
- chromium \
371
- chromium-driver \
372
- && apt-get clean \
373
- && rm --recursive --force /var/lib/apt/lists/*
374
-
375
333
# By default, sccache uses `~/.cache/sccache` locally: https://github.com/mozilla/sccache#local.
376
334
ENV RUSTC_WRAPPER sccache
377
335
378
336
# Disable cargo incremental compilation, as it conflicts with sccache: https://github.com/mozilla/sccache#rust
379
337
ENV CARGO_INCREMENTAL false
380
338
339
+ # Install Android SDK.
340
+ # https://developer.android.com/studio/#downloads
341
+ # https://developer.android.com/studio/index.html#command-tools
342
+ ARG android_sdk_version=8512546
343
+ ENV ANDROID_HOME /opt/android-sdk
344
+ ENV android_temp /tmp/android-sdk
345
+ RUN mkdir --parents "{android_temp}" \
346
+ && mkdir --parents "${ANDROID_HOME}/cmdline-tools/latest" \
347
+ && curl --location "https://dl.google.com/android/repository/commandlinetools-linux-${android_sdk_version}_latest.zip" > android_sdk.zip \
348
+ && unzip android_sdk.zip -d "${android_temp}" \
349
+ && mv ${android_temp}/cmdline-tools/* "${ANDROID_HOME}/cmdline-tools/latest/" \
350
+ && rm android_sdk.zip
351
+
352
+ # Install Android Platform Tools.
353
+ # https://developer.android.com/studio/releases/platform-tools
354
+ # https://developer.android.com/studio/releases/platforms
355
+ # https://developer.android.com/studio/releases/build-tools
356
+ ARG platform=30
357
+ ARG tools=30.0.0
358
+ RUN "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --update \
359
+ && (yes || true) | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses \
360
+ && (yes || true) | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" \
361
+ 'tools' 'platform-tools' 'cmake;3.6.4111459' \
362
+ "platforms;android-${platform}" "build-tools;${tools}" \
363
+ "system-images;android-${platform};default;x86_64"
364
+
365
+ # Set up Android SDK paths.
366
+ ENV PATH "${PATH}:${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin"
367
+ ENV LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib"
368
+
369
+ # Install Android NDK
370
+ # https://developer.android.com/ndk/downloads
371
+ ARG android_ndk_version=r25b
372
+ ENV ANDROID_NDK_HOME /opt/android-ndk
373
+ RUN mkdir --parents "${ANDROID_NDK_HOME}" \
374
+ && curl --location "https://dl.google.com/android/repository/android-ndk-${android_ndk_version}-linux.zip" > android_ndk.zip \
375
+ && unzip android_ndk.zip -d "${ANDROID_NDK_HOME}" \
376
+ && mv ${ANDROID_NDK_HOME}/android-ndk-${android_ndk_version}/* "${ANDROID_NDK_HOME}" \
377
+ && rm android_ndk.zip
378
+
381
379
# To make the scripts available to call from everywhere.
382
380
ENV PATH "/workspace/scripts:${PATH}"
383
381
0 commit comments