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
7 changes: 4 additions & 3 deletions .github/workflows/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
env:
CONTAINER_REGISTRY: ghcr.io
BUILDKIT_PROGRESS: plain
CONAN_VERSION: 2.17.0
CONAN_VERSION: 2.18.0
GCOVR_VERSION: 8.3
NONROOT_USER: ci
FALLBACK_GCC: 12
FALLBACK_CLANG: 16
Expand Down Expand Up @@ -98,9 +99,9 @@ jobs:
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
BUILDKIT_INLINE_CACHE=1
CLANG_VERSION=${{ matrix.os.compiler_name == 'clang' && matrix.os.compiler_version || env.FALLBACK_CLANG }}
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
CONAN_VERSION=${{ env.CONAN_VERSION }}
GITHUB_REPO=${{ github.repository }}
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
NONROOT_USER=${{ env.NONROOT_USER }}
DEBIAN_VERSION=${{ matrix.os.release }}
context: docker/debian
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ env:
CONTAINER_REGISTRY: ghcr.io
REDHAT_REGISTRY: registry.redhat.io
BUILDKIT_PROGRESS: plain
CONAN_VERSION: 2.17.0
CONAN_VERSION: 2.18.0
GCOVR_VERSION: 8.3
NONROOT_USER: ci

jobs:
Expand Down Expand Up @@ -90,7 +91,7 @@ jobs:
BUILDKIT_INLINE_CACHE=1
CONAN_VERSION=${{ env.CONAN_VERSION }}
GCC_VERSION=${{ matrix.os.compiler_version }}
GITHUB_REPO=${{ github.repository }}
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
NONROOT_USER=${{ env.NONROOT_USER }}
RHEL_VERSION=${{ matrix.os.release }}
context: docker/rhel
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
env:
CONTAINER_REGISTRY: ghcr.io
BUILDKIT_PROGRESS: plain
CONAN_VERSION: 2.17.0
CONAN_VERSION: 2.18.0
GCOVR_VERSION: 8.3
NONROOT_USER: ci
FALLBACK_GCC: 12
FALLBACK_CLANG: 16
Expand Down Expand Up @@ -96,9 +97,9 @@ jobs:
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
BUILDKIT_INLINE_CACHE=1
CLANG_VERSION=${{ matrix.os.compiler_name == 'clang' && matrix.os.compiler_version || env.FALLBACK_CLANG }}
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
CONAN_VERSION=${{ env.CONAN_VERSION }}
GITHUB_REPO=${{ github.repository }}
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
NONROOT_USER=${{ env.NONROOT_USER }}
UBUNTU_VERSION=${{ matrix.os.release }}
context: docker/ubuntu
Expand Down
26 changes: 15 additions & 11 deletions docker/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
apt update
apt upgrade -y
apt install -y tzdata
apt clean
rm -rf /var/lib/apt/lists/*
dpkg-reconfigure --frontend noninteractive tzdata
EOF

Expand All @@ -38,6 +40,8 @@ pkgs+=(bison) # Required build tool.
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
pkgs+=(cmake) # Required build tool.
pkgs+=(curl) # Dependency for tools requiring downloading data.
pkgs+=(dpkg-dev) # Required packaging tool.
pkgs+=(file) # Required packaging tool.
pkgs+=(flex) # Required build tool.
pkgs+=(git) # Required build tool.
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
Expand All @@ -47,15 +51,19 @@ pkgs+=(ninja-build) # Required build tool.
pkgs+=(pipx) # Package manager for Python applications.
pkgs+=(wget) # Required build tool.
apt update
apt install -y "${pkgs[@]}"
apt install -y --no-install-recommends "${pkgs[@]}"
apt clean
rm -rf /var/lib/apt/lists/*
EOF

# Install Conan.
# Install Python-based tools.
ARG CONAN_VERSION
RUN PIPX_HOME=/opt/pipx \
ARG GCOVR_VERSION
ENV PIPX_HOME=/opt/pipx \
PIPX_BIN_DIR=/usr/bin \
PIPX_MAN_DIR=/usr/share/man \
pipx install conan==${CONAN_VERSION}
PIPX_MAN_DIR=/usr/share/man
RUN pipx install --pip-args='--no-cache' conan==${CONAN_VERSION} && \
pipx install --pip-args='--no-cache' gcovr==${GCOVR_VERSION}

# Create the user to switch to, once all packages have been installed.
ARG NONROOT_USER
Expand Down Expand Up @@ -91,9 +99,6 @@ EOF
ENV CC=/usr/bin/gcc
ENV CXX=/usr/bin/g++

# Clean up unnecessary files to reduce image size.
RUN rm -rf /var/lib/apt/lists/* && apt clean

# Switch to the non-root user.
USER ${NONROOT_USER}
WORKDIR /home/${NONROOT_USER}
Expand Down Expand Up @@ -128,13 +133,12 @@ printf "%s\n%s\n" \
| tee /etc/apt/sources.list.d/llvm.list
apt update
apt install -t llvm-toolchain-${DEBIAN_VERSION}-${CLANG_VERSION} -y --no-install-recommends clang-${CLANG_VERSION} llvm-${CLANG_VERSION}
apt clean
rm -rf /var/lib/apt/lists/*
EOF
ENV CC=/usr/bin/clang-${CLANG_VERSION}
ENV CXX=/usr/bin/clang++-${CLANG_VERSION}

# Clean up unnecessary files to reduce image size.
RUN rm -rf /var/lib/apt/lists/* && apt clean

# Switch to the non-root user.
USER ${NONROOT_USER}
WORKDIR /home/${NONROOT_USER}
Expand Down
8 changes: 6 additions & 2 deletions docker/debian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ registry.
NONROOT_USER=${USER}
DEBIAN_VERSION=bookworm
GCC_VERSION=12
CONAN_VERSION=2.17.0
CONAN_VERSION=2.18.0
GCOVR_VERSION=8.3
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:gcc-${GCC_VERSION}

docker buildx build . \
Expand All @@ -50,6 +51,7 @@ docker buildx build . \
--build-arg CONAN_VERSION=${CONAN_VERSION} \
--build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
--build-arg GCC_VERSION=${GCC_VERSION} \
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
--build-arg NONROOT_USER=${NONROOT_USER} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
```
Expand All @@ -63,7 +65,8 @@ registry.
NONROOT_USER=${USER}
DEBIAN_VERSION=bookworm
CLANG_VERSION=17
CONAN_VERSION=2.17.0
CONAN_VERSION=2.18.0
GCOVR_VERSION=8.3
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:clang-${CLANG_VERSION}

docker buildx build . \
Expand All @@ -73,6 +76,7 @@ docker buildx build . \
--build-arg CLANG_VERSION=${CLANG_VERSION} \
--build-arg CONAN_VERSION=${CONAN_VERSION} \
--build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
--build-arg NONROOT_USER=${NONROOT_USER} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
```
Expand Down
28 changes: 18 additions & 10 deletions docker/rhel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,30 @@ RUN <<EOF
pkgs=()
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
pkgs+=(cmake) # Required build tool.
pkgs+=(file) # Required packaging tool.
pkgs+=(git) # Required build tool.
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
pkgs+=(jq) # Pretty printing.
pkgs+=(libstdc++-static) # Required to statically link libraries into rippled.
pkgs+=(ninja-build) # Required build tool.
pkgs+=(perl-FindBin) # Required to compile OpenSSL.
pkgs+=(python3-pip) # Package manager for Python applications.
pkgs+=(rpm-build) # Required packaging tool.
pkgs+=(rpmdevtools) # Required packaging tool.
pkgs+=(wget) # Required build tool.
dnf install -y --setopt=tsflags=nodocs "${pkgs[@]}"
dnf -y clean all
rm -rf /var/cache/dnf/*
EOF

# Copy Bison and Flex from the Rocky Linux image.
COPY --from=rocky /usr/bin/bison /usr/bin/bison
COPY --from=rocky /usr/bin/flex /usr/bin/flex

# Install Conan.
# Install Python-based tools.
ARG CONAN_VERSION
RUN pip install conan==${CONAN_VERSION}
ARG GCOVR_VERSION
RUN pip install --no-cache conan==${CONAN_VERSION} gcovr==${GCOVR_VERSION}

# Create the user to switch to, once all packages have been installed.
ARG NONROOT_USER
Expand All @@ -50,13 +56,14 @@ FROM base AS gcc

# Install GCC.
ARG GCC_VERSION
RUN dnf install -y --setopt=tsflags=nodocs gcc-toolset-${GCC_VERSION}-gcc gcc-toolset-${GCC_VERSION}-gcc-c++
RUN <<EOF
dnf install -y --setopt=tsflags=nodocs gcc-toolset-${GCC_VERSION}-gcc gcc-toolset-${GCC_VERSION}-gcc-c++
dnf -y clean all
rm -rf /var/cache/dnf/*
EOF
ENV CC=/usr/bin/gcc
ENV CXX=/usr/bin/g++

# Clean up unnecessary files to reduce image size.
RUN dnf -y clean all

# Switch to the non-root user.
USER ${NONROOT_USER}
WORKDIR /home/${NONROOT_USER}
Expand Down Expand Up @@ -84,13 +91,14 @@ FROM base AS clang

# Install Clang. Note that in the RHEL UBIs, we cannot choose the Clang version
# to install and we get what is available.
RUN dnf install -y --setopt=tsflags=nodocs clang llvm
RUN <<EOF
dnf install -y --setopt=tsflags=nodocs clang llvm
dnf -y clean all
rm -rf /var/cache/dnf/*
EOF
ENV CC=/usr/bin/clang
ENV CXX=/usr/bin/clang++

# Clean up unnecessary files to reduce image size.
RUN dnf -y clean all

# Switch to the non-root user.
USER ${NONROOT_USER}
WORKDIR /home/${NONROOT_USER}
Expand Down
8 changes: 6 additions & 2 deletions docker/rhel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ registry.
NONROOT_USER=${USER}
RHEL_VERSION=9.6
GCC_VERSION=13
CONAN_VERSION=2.17.0
CONAN_VERSION=2.18.0
GCOVR_VERSION=8.3
CONTAINER_IMAGE=xrplf/ci/rhel-${RHEL_VERSION}:gcc-${GCC_VERSION}

docker buildx build . \
Expand All @@ -68,6 +69,7 @@ docker buildx build . \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg CONAN_VERSION=${CONAN_VERSION} \
--build-arg GCC_VERSION=${GCC_VERSION} \
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
--build-arg NONROOT_USER=${NONROOT_USER} \
--build-arg RHEL_VERSION=${RHEL_VERSION} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
Expand All @@ -81,14 +83,16 @@ registry.
```shell
NONROOT_USER=${USER}
RHEL_VERSION=9.6
CONAN_VERSION=2.17.0
CONAN_VERSION=2.18.0
GCOVR_VERSION=8.3
CONTAINER_IMAGE=xrplf/ci/rhel-${RHEL_VERSION}:clang-${CLANG_VERSION}

docker buildx build . \
--target clang \
--build-arg BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg CONAN_VERSION=${CONAN_VERSION} \
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
--build-arg NONROOT_USER=${NONROOT_USER} \
--build-arg RHEL_VERSION=${RHEL_VERSION} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
Expand Down
36 changes: 23 additions & 13 deletions docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
apt update
apt upgrade -y
apt install -y tzdata
apt clean
rm -rf /var/lib/apt/lists/*
dpkg-reconfigure --frontend noninteractive tzdata
EOF

Expand All @@ -27,6 +29,8 @@ pkgs+=(bison) # Required build tool.
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
pkgs+=(cmake) # Required build tool.
pkgs+=(curl) # Dependency for tools requiring downloading data.
pkgs+=(dpkg-dev) # Required packaging tool.
pkgs+=(file) # Required packaging tool.
pkgs+=(flex) # Required build tool.
pkgs+=(git) # Required build tool.
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
Expand All @@ -36,15 +40,19 @@ pkgs+=(ninja-build) # Required build tool.
pkgs+=(pipx) # Package manager for Python applications.
pkgs+=(wget) # Required build tool.
apt update
apt install -y "${pkgs[@]}"
apt install -y --no-install-recommends "${pkgs[@]}"
apt clean
rm -rf /var/lib/apt/lists/*
EOF

# Install Conan.
# Install Python-based tools.
ARG CONAN_VERSION
RUN PIPX_HOME=/opt/pipx \
ARG GCOVR_VERSION
ENV PIPX_HOME=/opt/pipx \
PIPX_BIN_DIR=/usr/bin \
PIPX_MAN_DIR=/usr/share/man \
pipx install conan==${CONAN_VERSION}
PIPX_MAN_DIR=/usr/share/man
RUN pipx install --pip-args='--no-cache' conan==${CONAN_VERSION} && \
pipx install --pip-args='--no-cache' gcovr==${GCOVR_VERSION}

# Create the user to switch to, once all packages have been installed.
ARG NONROOT_USER
Expand All @@ -55,13 +63,14 @@ FROM base AS gcc

# Install GCC.
ARG GCC_VERSION
RUN apt install -y gcc-${GCC_VERSION} g++-${GCC_VERSION}
RUN <<EOF
apt install -y gcc-${GCC_VERSION} g++-${GCC_VERSION}
apt clean
rm -rf /var/lib/apt/lists/*
EOF
ENV CC=/usr/bin/gcc-${GCC_VERSION}
ENV CXX=/usr/bin/g++-${GCC_VERSION}

# Clean up unnecessary files to reduce image size.
RUN rm -rf /var/lib/apt/lists/* && apt clean

# Switch to the non-root user.
USER ${NONROOT_USER}
WORKDIR /home/${NONROOT_USER}
Expand All @@ -85,13 +94,14 @@ FROM base AS clang

# Install Clang.
ARG CLANG_VERSION
RUN apt install -y clang-${CLANG_VERSION} llvm-${CLANG_VERSION}
RUN <<EOF
apt install -y clang-${CLANG_VERSION} llvm-${CLANG_VERSION}
apt clean
rm -rf /var/lib/apt/lists/*
EOF
ENV CC=/usr/bin/clang-${CLANG_VERSION}
ENV CXX=/usr/bin/clang++-${CLANG_VERSION}

# Clean up unnecessary files to reduce image size.
RUN rm -rf /var/lib/apt/lists/* && apt clean

# Switch to the non-root user.
USER ${NONROOT_USER}
WORKDIR /home/${NONROOT_USER}
Expand Down
8 changes: 6 additions & 2 deletions docker/ubuntu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ registry.
NONROOT_USER=${USER}
UBUNTU_VERSION=noble
GCC_VERSION=14
CONAN_VERSION=2.17.0
CONAN_VERSION=2.18.0
GCOVR_VERSION=8.3
CONTAINER_IMAGE=xrplf/ci/ubuntu-${UBUNTU_VERSION}:gcc-${GCC_VERSION}

docker buildx build . \
Expand All @@ -49,6 +50,7 @@ docker buildx build . \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg CONAN_VERSION=${CONAN_VERSION} \
--build-arg GCC_VERSION=${GCC_VERSION} \
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
--build-arg NONROOT_USER=${NONROOT_USER} \
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
Expand All @@ -63,7 +65,8 @@ registry.
NONROOT_USER=${USER}
UBUNTU_VERSION=noble
CLANG_VERSION=18
CONAN_VERSION=2.17.0
CONAN_VERSION=2.18.0
GCOVR_VERSION=8.3
CONTAINER_IMAGE=xrplf/ci/ubuntu-${UBUNTU_VERSION}:clang-${CLANG_VERSION}

docker buildx build . \
Expand All @@ -72,6 +75,7 @@ docker buildx build . \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg CLANG_VERSION=${CLANG_VERSION} \
--build-arg CONAN_VERSION=${CONAN_VERSION} \
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
--build-arg NONROOT_USER=${NONROOT_USER} \
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
Expand Down