Skip to content

Commit f68bead

Browse files
authored
Add Debian Bullseye with GCC 12 (#37)
1 parent a8fff03 commit f68bead

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

.github/workflows/debian.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
BUILDKIT_PROGRESS: plain
2222
CONAN_VERSION: 2.19.1
2323
GCOVR_VERSION: 8.3
24+
CMAKE_VERSION: 3.31.6
2425
FALLBACK_GCC: 12
2526
FALLBACK_CLANG: 16
2627

@@ -36,6 +37,9 @@ jobs:
3637
- platform: linux/arm64
3738
runner: ubuntu-24.04-arm
3839
os:
40+
- release: bullseye
41+
compiler_name: gcc
42+
compiler_version: 12
3943
- release: bookworm
4044
compiler_name: gcc
4145
compiler_version: 12
@@ -114,6 +118,7 @@ jobs:
114118
CONAN_VERSION=${{ env.CONAN_VERSION }}
115119
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
116120
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
121+
CMAKE_VERSION=${{ env.CMAKE_VERSION }}
117122
DEBIAN_VERSION=${{ matrix.os.release }}
118123
context: .
119124
file: docker/debian/Dockerfile
@@ -144,6 +149,9 @@ jobs:
144149
strategy:
145150
matrix:
146151
os:
152+
- release: bullseye
153+
compiler_name: gcc
154+
compiler_version: 12
147155
- release: bookworm
148156
compiler_name: gcc
149157
compiler_version: 12

docker/debian/Dockerfile

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ EOF
3737
RUN <<EOF
3838
pkgs=()
3939
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
40-
pkgs+=(cmake) # Required build tool.
4140
pkgs+=(curl) # Dependency for tools requiring downloading data.
4241
pkgs+=(dpkg-dev) # Required packaging tool.
42+
pkgs+=(debhelper) # Required packaging tool.
4343
pkgs+=(file) # Required packaging tool.
4444
pkgs+=(git) # Required build tool.
4545
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
4646
pkgs+=(gpg-agent) # Dependency for tools requiring signing or encrypting/decrypting.
4747
pkgs+=(jq) # JSON manipulation.
4848
pkgs+=(libc6-dev) # Required build tool.
4949
pkgs+=(ninja-build) # Required build tool.
50-
pkgs+=(pipx) # Package manager for Python applications.
51-
pkgs+=(python3-jinja2) # Required build tool.
50+
pkgs+=(python3-venv) # Python environment management tool.
51+
pkgs+=(python3-pip) # Package manager for Python applications.
5252
pkgs+=(vim) # Text editor.
5353
pkgs+=(wget) # Required build tool.
5454
apt-get update
@@ -60,11 +60,15 @@ EOF
6060
# Install Python-based tools.
6161
ARG CONAN_VERSION
6262
ARG GCOVR_VERSION
63-
ENV PIPX_HOME=/opt/pipx \
64-
PIPX_BIN_DIR=/usr/bin \
65-
PIPX_MAN_DIR=/usr/share/man
66-
RUN pipx install --pip-args='--no-cache' conan==${CONAN_VERSION} && \
67-
pipx install --pip-args='--no-cache' gcovr==${GCOVR_VERSION}
63+
ARG CMAKE_VERSION
64+
65+
ENV VIRTUAL_ENV=/opt/venv
66+
RUN python3 -m venv ${VIRTUAL_ENV}
67+
ENV PATH=${VIRTUAL_ENV}/bin:${PATH}
68+
RUN pip install --no-cache \
69+
conan==${CONAN_VERSION} \
70+
gcovr==${GCOVR_VERSION} \
71+
cmake==${CMAKE_VERSION}
6872

6973
# ====================== GCC IMAGE ======================
7074
FROM base AS gcc
@@ -83,6 +87,13 @@ ldconfig -v
8387
dpkg-divert --divert /usr/bin/gcc.orig --rename /usr/bin/gcc
8488
dpkg-divert --divert /usr/bin/g++.orig --rename /usr/bin/g++
8589
dpkg-divert --divert /usr/bin/gfortran.orig --rename /usr/bin/gfortran
90+
dpkg-divert --divert /usr/bin/gcc-ar.orig --rename /usr/bin/gcc-ar
91+
dpkg-divert --divert /usr/bin/gcc-nm.orig --rename /usr/bin/gcc-nm
92+
dpkg-divert --divert /usr/bin/gcc-ranlib.orig --rename /usr/bin/gcc-ranlib
93+
dpkg-divert --divert /usr/bin/gcov.orig --rename /usr/bin/gcov
94+
dpkg-divert --divert /usr/bin/gcov-tool.orig --rename /usr/bin/gcov-tool
95+
dpkg-divert --divert /usr/bin/gcov-dump.orig --rename /usr/bin/gcov-dump
96+
dpkg-divert --divert /usr/bin/lto-dump.orig --rename /usr/bin/lto-dump
8697
update-alternatives \
8798
--install /usr/bin/cc cc /usr/local/bin/gcc 999
8899
update-alternatives \

docker/debian/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ versions by specifying the `DEBIAN_VERSION` build argument. There are additional
2929
arguments to specify as well, namely `GCC_VERSION` for the GCC flavor and
3030
`CLANG_VERSION` for the Clang flavor.
3131

32-
None of the build images support packaging, since (in order to be access the
33-
most recent official releases) the compilers are installed from external
34-
sources:
35-
36-
* [gcc Docker Official Image](https://hub.docker.com/_/gcc)
37-
* [LLVM Debian/Ubuntu nightly packages](https://apt.llvm.org/)
32+
Build image for `gcc` supports packaging.
3833

3934
In order to build an image, run the commands below from the root directory of
4035
the repository.
@@ -49,6 +44,7 @@ DEBIAN_VERSION=bookworm
4944
GCC_VERSION=12
5045
CONAN_VERSION=2.19.1
5146
GCOVR_VERSION=8.3
47+
CMAKE_VERSION=3.31.6
5248
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:gcc-${GCC_VERSION}
5349

5450
docker buildx build . \
@@ -60,6 +56,7 @@ docker buildx build . \
6056
--build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
6157
--build-arg GCC_VERSION=${GCC_VERSION} \
6258
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
59+
--build-arg CMAKE_VERSION=${CMAKE_VERSION} \
6360
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
6461
```
6562

@@ -73,6 +70,7 @@ DEBIAN_VERSION=bookworm
7370
CLANG_VERSION=17
7471
CONAN_VERSION=2.19.1
7572
GCOVR_VERSION=8.3
73+
CMAKE_VERSION=3.31.6
7674
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:clang-${CLANG_VERSION}
7775

7876
docker buildx build . \
@@ -84,6 +82,7 @@ docker buildx build . \
8482
--build-arg CONAN_VERSION=${CONAN_VERSION} \
8583
--build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
8684
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
85+
--build-arg CMAKE_VERSION=${CMAKE_VERSION} \
8786
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
8887
```
8988

0 commit comments

Comments
 (0)