ci: Turn centos config into alpine musl config
What changed, and why it matters
This commit swaps one continuous-integration (CI) test runner from CentOS to Alpine Linux (musl). It only changes build/test automation files, not the Bitcoin Core software that users run. There is no security-relevant code change here.
No security action required. Treat as routine CI maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch replaces the native CentOS CI configuration with an Alpine (musl libc) configuration: renames/deletes the CentOS env script, adds an Alpine env script, updates package installation logic from dnf to apk, adjusts the dash shell path for depends builds, and ensures bash is installed in the Alpine container image. It is purely CI infrastructure maintenance.
Changed components
.github/workflows/ci.ymlci/test/00_setup_env_native_alpine_musl.shci/test/00_setup_env_native_centos.shci/test/01_base_install.shci/test/03_test_script.shci/test_imagefileInspect captured patch +34 / −30
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a5cae564..858a2caf 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -477,11 +477,11 @@ jobs:
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_previous_releases.sh'
- - name: 'CentOS, depends, gui'
+ - name: 'Alpine (musl), depends, gui'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
- file-env: './ci/test/00_setup_env_native_centos.sh'
+ file-env: './ci/test/00_setup_env_native_alpine_musl.sh'
- name: 'tidy'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
diff --git a/ci/test/00_setup_env_native_alpine_musl.sh b/ci/test/00_setup_env_native_alpine_musl.sh
new file mode 100755
index 00000000..094709ff
--- /dev/null
+++ b/ci/test/00_setup_env_native_alpine_musl.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2020-present The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+export LC_ALL=C.UTF-8
+
+export CONTAINER_NAME=ci_native_alpine_musl
+export CI_IMAGE_NAME_TAG="mirror.gcr.io/alpine:3.22"
+export CI_BASE_PACKAGES="build-base musl-dev pkgconf curl ccache make ninja git python3 py3-pip which patch xz procps rsync util-linux bison e2fsprogs cmake dash linux-headers"
+export PIP_PACKAGES="--break-system-packages pyzmq pycapnp"
+export DEP_OPTS="DEBUG=1"
+export GOAL="install"
+export BITCOIN_CONFIG="\
+ -DWITH_ZMQ=ON \
+ -DBUILD_GUI=ON \
+ -DREDUCE_EXPORTS=ON \
+ -DCMAKE_BUILD_TYPE=Debug \
+"
+export BITCOIN_CMD="bitcoin -m" # Used in functional tests
diff --git a/ci/test/00_setup_env_native_centos.sh b/ci/test/00_setup_env_native_centos.sh
deleted file mode 100755
index 998ddaf4..00000000
--- a/ci/test/00_setup_env_native_centos.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright (c) 2020-present The Bitcoin Core developers
-# Distributed under the MIT software license, see the accompanying
-# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-export LC_ALL=C.UTF-8
-
-export CONTAINER_NAME=ci_native_centos
-export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream10"
-export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make ninja-build git python3 python3-pip which patch xz procps-ng rsync coreutils bison e2fsprogs cmake dash"
-export PIP_PACKAGES="pyzmq pycapnp"
-export DEP_OPTS="DEBUG=1"
-export GOAL="install"
-export BITCOIN_CONFIG="\
- -DWITH_ZMQ=ON \
- -DBUILD_GUI=ON \
- -DREDUCE_EXPORTS=ON \
- -DCMAKE_BUILD_TYPE=Debug \
-"
-export BITCOIN_CMD="bitcoin -m" # Used in functional tests
diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh
index ce460987..144b9ab2 100755
--- a/ci/test/01_base_install.sh
+++ b/ci/test/01_base_install.sh
@@ -32,16 +32,17 @@ if [ -n "${APT_LLVM_V}" ]; then
)
fi
-if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
- bash -c "dnf -y install epel-release"
- # The ninja-build package is available in the CRB repository.
- bash -c "dnf -y --allowerasing --enablerepo crb install $CI_BASE_PACKAGES $PACKAGES"
+if [[ $CI_IMAGE_NAME_TAG == *alpine* ]]; then
+ ${CI_RETRY_EXE} apk update
+ # shellcheck disable=SC2086
+ ${CI_RETRY_EXE} apk add --no-cache $CI_BASE_PACKAGES $PACKAGES
elif [ "$CI_OS_NAME" != "macos" ]; then
if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then
echo "${APPEND_APT_SOURCES_LIST}" >> /etc/apt/sources.list
fi
${CI_RETRY_EXE} apt-get update
- ${CI_RETRY_EXE} bash -c "apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $CI_BASE_PACKAGES"
+ # shellcheck disable=SC2086
+ ${CI_RETRY_EXE} apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $CI_BASE_PACKAGES
fi
if [ -n "${APT_LLVM_V}" ]; then
diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh
index 05e4d8fd..9353f624 100755
--- a/ci/test/03_test_script.sh
+++ b/ci/test/03_test_script.sh
@@ -99,8 +99,8 @@ else
fi
if [ -z "$NO_DEPENDS" ]; then
- if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
- SHELL_OPTS="CONFIG_SHELL=/bin/dash"
+ if [[ $CI_IMAGE_NAME_TAG == *alpine* ]]; then
+ SHELL_OPTS="CONFIG_SHELL=/usr/bin/dash"
else
SHELL_OPTS="CONFIG_SHELL="
fi
diff --git a/ci/test_imagefile b/ci/test_imagefile
index f9cf3187..a0e1714e 100644
--- a/ci/test_imagefile
+++ b/ci/test_imagefile
@@ -17,4 +17,7 @@ ENV BASE_ROOT_DIR=${BASE_ROOT_DIR}
COPY ./ci/retry/retry /usr/bin/retry
COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_container_base/ci/test/
+# Bash is required, so install it when missing
+RUN sh -c "bash -c 'true' || ( apk update && apk add --no-cache bash )"
+
RUN ["bash", "-c", "cd /ci_container_base/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.