Skip to content

Commit 26aff36

Browse files
authored
build: bump Alpine version to 3.21 (#2074)
1 parent 9daa195 commit 26aff36

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# conflicts in case of parallel compilation.
4545
# 3. Configuration variables are shared between runs using /root/env file.
4646

47-
ARG ALPINE_VERSION=3.18
47+
ARG ALPINE_VERSION=3.21
4848

4949
# deps-${RUSTC_WRAPPER:-base}
5050
# If one of SCCACHE_GHA_ENABLED, SCCACHE_BUCKET, SCCACHE_MEMCACHED is set, then deps-sccache is used, otherwise deps-base
@@ -72,6 +72,7 @@ RUN apk add --no-cache \
7272
ca-certificates \
7373
clang-static clang-dev \
7474
cmake \
75+
curl \
7576
git \
7677
libc-dev \
7778
linux-headers \
@@ -148,7 +149,13 @@ RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export PROTOC_ARCH=aarch_64; else e
148149
ln -s /opt/protoc/bin/protoc /usr/bin/
149150

150151
# Switch to clang
151-
RUN rm /usr/bin/cc && ln -s /usr/bin/clang /usr/bin/cc
152+
# Note that CC / CXX can be updated later on (eg. when configuring sccache)
153+
RUN rm /usr/bin/cc && \
154+
ln -s /usr/bin/clang /usr/bin/cc
155+
RUN <<EOS
156+
echo "export CXX='clang++'" >> /root/env
157+
echo "export CC='clang'" >> /root/env
158+
EOS
152159

153160
ARG NODE_ENV=production
154161
ENV NODE_ENV=${NODE_ENV}
@@ -287,6 +294,7 @@ git clone https://github.com/facebook/rocksdb.git -b v9.9.3 --depth 1 .
287294
source /root/env
288295

289296
make -j$(nproc) static_lib
297+
290298
mkdir -p /opt/rocksdb/usr/local/lib
291299
cp librocksdb.a /opt/rocksdb/usr/local/lib/
292300
cp -r include /opt/rocksdb/usr/local/
@@ -492,11 +500,13 @@ WORKDIR /platform
492500
COPY --from=build-planner /platform/recipe.json recipe.json
493501

494502
# Build dependencies - this is the caching Docker layer!
503+
# Note we unset CFLAGS and CXXFLAGS as they have `-march` included, which breaks wasm32 build
495504
RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOME}/registry/index \
496505
--mount=type=cache,sharing=shared,id=cargo_registry_cache,target=${CARGO_HOME}/registry/cache \
497506
--mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \
498507
--mount=type=secret,id=AWS \
499508
source /root/env && \
509+
unset CFLAGS CXXFLAGS && \
500510
cargo chef cook \
501511
--recipe-path recipe.json \
502512
--profile "$CARGO_BUILD_PROFILE" \
@@ -543,12 +553,14 @@ COPY --parents \
543553
packages/dash-spv \
544554
/platform/
545555

556+
# We unset CFLAGS CXXFLAGS because they hold `march` flags which break wasm32 build
546557
RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOME}/registry/index \
547558
--mount=type=cache,sharing=shared,id=cargo_registry_cache,target=${CARGO_HOME}/registry/cache \
548559
--mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \
549560
--mount=type=cache,sharing=shared,id=unplugged_${TARGETARCH},target=/tmp/unplugged \
550561
--mount=type=secret,id=AWS \
551562
source /root/env && \
563+
unset CFLAGS CXXFLAGS && \
552564
cp -R /tmp/unplugged /platform/.yarn/ && \
553565
yarn install --inline-builds && \
554566
cp -R /platform/.yarn/unplugged /tmp/ && \

0 commit comments

Comments
 (0)