Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 42 additions & 22 deletions docker/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,6 @@ RUN pip install --no-cache \
gcovr==${GCOVR_VERSION} \
cmake==${CMAKE_VERSION}

# Install ccache. Note that the ccache version from the package manager is
# installed for Debian Bullseye, as the latest version requires a newer GLIBC
# version, and older compatible releases are x86-64 only.
ARG CCACHE_VERSION

RUN <<EOF
if [[ "${DEBIAN_VERSION}" == "bullseye" ]]; then
apt-get update
apt-get install -y --no-install-recommends ccache
apt-get clean
rm -rf /var/lib/apt/lists/*
else
ARCH=$(uname -m)
wget -O ccache.tar.xz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-${ARCH}.tar.xz
tar -xf ccache.tar.xz
cp ccache-${CCACHE_VERSION}-linux-${ARCH}/ccache /usr/local/bin
rm -r ccache-${CCACHE_VERSION}-linux-${ARCH}
rm ccache.tar.xz
fi
EOF

# Install mold.
ARG MOLD_VERSION

Expand All @@ -119,7 +98,6 @@ ENV PATH="$CARGO_HOME/bin:$PATH"

# Print versions.
RUN <<EOF
ccache --version
cmake --version
conan --version
gcovr --version
Expand Down Expand Up @@ -192,6 +170,27 @@ if [[ "${CXX_VER}" != "${GCC_VERSION}" ]]; then
fi
EOF

# Build ccache from source to avoid incompatible GLIBC versions.
ARG CCACHE_VERSION

RUN <<EOF
wget -O ccache.tar.gz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz
tar -xzf ccache.tar.gz
rm ccache.tar.gz
cd ccache-${CCACHE_VERSION}

# Build, install, and clean up.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ..
make -j install
cd ../..
rm -rf ccache-${CCACHE_VERSION}

# Verify the installation.
ccache --version
EOF

# Set the Conan home directory, so the users of this image can find the default
# profile.
ENV HOME=/root
Expand Down Expand Up @@ -285,6 +284,27 @@ if [[ "${CXX_VER}" != "${CLANG_VERSION}" ]]; then
fi
EOF

# Build ccache from source to avoid incompatible GLIBC versions.
ARG CCACHE_VERSION

RUN <<EOF
wget -O ccache.tar.gz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz
tar -xzf ccache.tar.gz
rm ccache.tar.gz
cd ccache-${CCACHE_VERSION}

# Build, install, and clean up.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ..
make -j install
cd ../..
rm -rf ccache-${CCACHE_VERSION}

# Verify the installation.
ccache --version
EOF

# Set the Conan home directory, so the users of this image can find the default
# profile.
ENV HOME=/root
Expand Down
6 changes: 6 additions & 0 deletions docker/debian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ In order to build a GCC image for Bullseye, you also need to explicitly set
`BASE_IMAGE` build argument, e.g.

```shell
# The version of the distro to use.
DEBIAN_VERSION=bullseye
# The version of GCC to use, including corresponding base image.
GCC_VERSION=12
BASE_IMAGE=ghcr.io/xrplf/ci/gcc:${GCC_VERSION}-bullseye
# The versions of the tools to use.
CCACHE_VERSION=4.12.2
CMAKE_VERSION=4.1.0
CONAN_VERSION=2.22.2
Expand Down Expand Up @@ -100,8 +103,11 @@ In order to build an image for Clang, run the commands below from the root
directory of the repository.

```shell
# The version of the distro to use.
DEBIAN_VERSION=bookworm
# The version of Clang to use.
CLANG_VERSION=17
# The versions of the tools to use.
CCACHE_VERSION=4.12.2
CMAKE_VERSION=4.1.0
CONAN_VERSION=2.22.2
Expand Down
70 changes: 48 additions & 22 deletions docker/rhel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,6 @@ RUN pip install --no-cache \
gcovr==${GCOVR_VERSION} \
cmake==${CMAKE_VERSION}

# Install ccache. Note that the ccache version from the package manager is
# installed for RHEL 8, as the latest version requires a newer GLIBC version,
# and older compatible releases are x86-64 only.
ARG CCACHE_VERSION

RUN <<EOF
if [[ "${RHEL_VERSION}" == "8" ]]; then
dnf update -y
dnf install -y --allowerasing --setopt=tsflags=nodocs ccache
dnf clean -y all
rm -rf /var/cache/dnf/*
else
ARCH=$(uname -m)
wget -O ccache.tar.xz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-${ARCH}.tar.xz
tar -xf ccache.tar.xz
cp ccache-${CCACHE_VERSION}-linux-${ARCH}/ccache /usr/local/bin
rm -r ccache-${CCACHE_VERSION}-linux-${ARCH}
rm ccache.tar.xz
fi
EOF

# Install mold.
ARG MOLD_VERSION

Expand All @@ -130,7 +109,6 @@ ENV PATH="$CARGO_HOME/bin:$PATH"

# Print versions.
RUN <<EOF
ccache --version
cmake --version
conan --version
gcovr --version
Expand Down Expand Up @@ -204,6 +182,30 @@ if [[ "${CXX_VER}" != "${GCC_VERSION}" ]]; then
fi
EOF

# Build ccache from source to avoid incompatible GLIBC versions.
ARG CCACHE_VERSION

RUN <<EOF
wget -O ccache.tar.gz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz
tar -xzf ccache.tar.gz
rm ccache.tar.gz
cd ccache-${CCACHE_VERSION}

# Build, install, and clean up.
mkdir build
cd build
if [[ "${RHEL_VERSION}" -eq "8" ]]; then
LINKER_OPTION='-D USE_FASTER_LINKER=OFF'
fi
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ${LINKER_OPTION} ..
make -j install
cd ../..
rm -rf ccache-${CCACHE_VERSION}

# Verify the installation.
ccache --version
EOF

# Set the Conan home directory, so the users of this image can find the default
# profile.
ENV HOME=/root
Expand Down Expand Up @@ -280,6 +282,30 @@ if [[ ${CXX_VER} -lt ${MINIMUM_CLANG_VERSION} ]]; then
fi
EOF

# Build ccache from source to avoid incompatible GLIBC versions.
ARG CCACHE_VERSION

RUN <<EOF
wget -O ccache.tar.gz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz
tar -xzf ccache.tar.gz
rm ccache.tar.gz
cd ccache-${CCACHE_VERSION}

# Build, install, and clean up.
mkdir build
cd build
if [[ "${RHEL_VERSION}" -eq "8" ]]; then
LINKER_OPTION='-D USE_FASTER_LINKER=OFF'
fi
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ${LINKER_OPTION} ..
make -j install
cd ../..
rm -rf ccache-${CCACHE_VERSION}

# Verify the installation.
ccache --version
EOF

# Set the Conan home directory, so the users of this image can find the default
# profile.
ENV HOME=/root
Expand Down
5 changes: 5 additions & 0 deletions docker/rhel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ In order to build the image for GCC, run the commands below from the root
directory of the repository.

```shell
# The version of the distro to use.
RHEL_VERSION=9
# The version of GCC to use.
GCC_VERSION=12
# The versions of the tools to use.
CCACHE_VERSION=4.12.2
CMAKE_VERSION=4.1.0
CONAN_VERSION=2.22.2
Expand Down Expand Up @@ -55,7 +58,9 @@ In order to build the image for Clang, run the commands below from the root
directory of the repository.

```shell
# The version of the distro to use.
RHEL_VERSION=10
# The versions of the tools to use.
CCACHE_VERSION=4.12.2
CMAKE_VERSION=4.1.0
CONAN_VERSION=2.22.2
Expand Down
55 changes: 42 additions & 13 deletions docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@ RUN pip install --no-cache \
gcovr==${GCOVR_VERSION} \
cmake==${CMAKE_VERSION}

# Install ccache.
ARG CCACHE_VERSION

RUN <<EOF
ARCH=$(uname -m)
wget -O ccache.tar.xz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-${ARCH}.tar.xz
tar -xf ccache.tar.xz
cp ccache-${CCACHE_VERSION}-linux-${ARCH}/ccache /usr/local/bin
rm -r ccache-${CCACHE_VERSION}-linux-${ARCH}
rm ccache.tar.xz
EOF

# Install mold.
ARG MOLD_VERSION

Expand All @@ -93,7 +81,6 @@ ENV PATH="$CARGO_HOME/bin:$PATH"

# Print versions.
RUN <<EOF
ccache --version
cmake --version
conan --version
gcovr --version
Expand Down Expand Up @@ -156,6 +143,27 @@ if [[ "${CXX_VER}" != "${GCC_VERSION}" ]]; then
fi
EOF

# Build ccache from source to avoid incompatible GLIBC versions.
ARG CCACHE_VERSION

RUN <<EOF
wget -O ccache.tar.gz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz
tar -xzf ccache.tar.gz
rm ccache.tar.gz
cd ccache-${CCACHE_VERSION}

# Build, install, and clean up.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ..
make -j install
cd ../..
rm -rf ccache-${CCACHE_VERSION}

# Verify the installation.
ccache --version
EOF

# Set the Conan home directory, so the users of this image can find the default
# profile.
ENV HOME=/root
Expand Down Expand Up @@ -244,6 +252,27 @@ if [[ "${CXX_VER}" != "${CLANG_VERSION}" ]]; then
fi
EOF

# Build ccache from source to avoid incompatible GLIBC versions.
ARG CCACHE_VERSION

RUN <<EOF
wget -O ccache.tar.gz https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz
tar -xzf ccache.tar.gz
rm ccache.tar.gz
cd ccache-${CCACHE_VERSION}

# Build, install, and clean up.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ..
make -j install
cd ../..
rm -rf ccache-${CCACHE_VERSION}

# Verify the installation.
ccache --version
EOF

# Set the Conan home directory, so the users of this image can find the default
# profile.
ENV HOME=/root
Expand Down
8 changes: 8 additions & 0 deletions docker/ubuntu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ In order to build the image for GCC, run the commands below from the root
directory of the repository.

```shell
# The version of the distro to use.
UBUNTU_VERSION=noble
# The version of GCC to use.
GCC_VERSION=14
# The versions of the tools to use.
CCACHE_VERSION=4.12.2
CMAKE_VERSION=4.1.0
CONAN_VERSION=2.22.2
GCOVR_VERSION=8.3
MOLD_VERSION=2.40.4
RUST_VERSION=1.91.1
# The name of the image to build.
CONTAINER_IMAGE=ghcr.io/xrplf/ci/ubuntu-${UBUNTU_VERSION}:gcc-${GCC_VERSION}

docker buildx build . \
Expand All @@ -54,14 +58,18 @@ In order to build the image for Clang, run the commands below from the root
directory of the repository.

```shell
# The version of the distro to use.
UBUNTU_VERSION=noble
# The version of Clang to use.
CLANG_VERSION=18
# The versions of the tools to use.
CCACHE_VERSION=4.12.2
CMAKE_VERSION=4.1.0
CONAN_VERSION=2.22.2
GCOVR_VERSION=8.3
MOLD_VERSION=2.40.4
RUST_VERSION=1.91.1
# The name of the image to build.
CONTAINER_IMAGE=ghcr.io/xrplf/ci/ubuntu-${UBUNTU_VERSION}:clang-${CLANG_VERSION}

docker buildx build . \
Expand Down