From: Joel Rosdahl Date: Sat, 3 May 2025 08:20:30 +0000 (+0200) Subject: chore: Clean up and modernize dockerfiles X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc46e6574d69ddd4d087ed0fb8d9f6faad769408;p=thirdparty%2Fccache.git chore: Clean up and modernize dockerfiles --- diff --git a/dockerfiles/README b/dockerfiles/README index d1de6859..4bf08702 100644 --- a/dockerfiles/README +++ b/dockerfiles/README @@ -1,11 +1,12 @@ -This directory contains Dockerfiles for building and testing ccache in -different build environments. +This directory contains Dockerfiles for building and testing ccache in different +build environments. These are unofficial Dockerfiles only intended for use by +ccache developers locally. -For instance, run something like this to build ccache in Ubuntu 20.04: +For instance, run something like this to build ccache in Ubuntu 24.04: - misc/build-in-docker ubuntu-20.04 + misc/build-in-docker ubuntu-24.04 -The above command will first build the Ubuntu 20.04 Docker image if needed and +The above command will first build the Ubuntu 24.04 Docker image if needed and finally build ccache and run the ccache test suite. -See also misc/test-all-systems. +See also misc/test-some-systems. diff --git a/dockerfiles/alpine-3.15/Dockerfile b/dockerfiles/alpine-3.15/Dockerfile deleted file mode 100644 index ff3d4c16..00000000 --- a/dockerfiles/alpine-3.15/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -ARG BASE_IMAGE=alpine:3.15 -FROM ${BASE_IMAGE} AS build - -RUN apk add --no-cache \ - bash \ - ccache \ - clang \ - cmake \ - elfutils \ - g++ \ - gcc \ - hiredis-dev \ - libc-dev \ - make \ - perl \ - python3 \ - redis \ - zstd-dev - -# Redirect all compilers to ccache. -RUN for t in gcc g++ cc c++ clang clang++; do ln -vs /usr/bin/ccache /usr/local/bin/$t; done diff --git a/dockerfiles/alpine-3.11/Dockerfile b/dockerfiles/alpine-3.21/Dockerfile similarity index 93% rename from dockerfiles/alpine-3.11/Dockerfile rename to dockerfiles/alpine-3.21/Dockerfile index 8bc04cb3..4eec71bc 100644 --- a/dockerfiles/alpine-3.11/Dockerfile +++ b/dockerfiles/alpine-3.21/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=alpine:3.11 +ARG BASE_IMAGE=alpine:3.21 FROM ${BASE_IMAGE} AS build RUN apk add --no-cache \ diff --git a/dockerfiles/fedora-36/Dockerfile b/dockerfiles/fedora-36/Dockerfile deleted file mode 100644 index d7aa9c56..00000000 --- a/dockerfiles/fedora-36/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -ARG BASE_IMAGE=fedora:36 -FROM ${BASE_IMAGE} AS build - -RUN dnf install -y \ - autoconf \ - bash \ - ccache \ - clang \ - cmake \ - diffutils \ - elfutils \ - findutils \ - gcc \ - gcc-c++ \ - libstdc++-static \ - hiredis-devel \ - libzstd-devel \ - make \ - python3 \ - redis \ - && dnf clean all diff --git a/dockerfiles/fedora-40/Dockerfile b/dockerfiles/fedora-42/Dockerfile similarity index 95% rename from dockerfiles/fedora-40/Dockerfile rename to dockerfiles/fedora-42/Dockerfile index b9f0b4ac..48bd0a80 100644 --- a/dockerfiles/fedora-40/Dockerfile +++ b/dockerfiles/fedora-42/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=fedora:40 +ARG BASE_IMAGE=fedora:42 FROM ${BASE_IMAGE} AS build RUN dnf install -y \ diff --git a/misc/test-all-systems b/misc/test-all-systems deleted file mode 100755 index 524597f5..00000000 --- a/misc/test-all-systems +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# -# While it's obviously quite impossible to support and test every single -# distribution, this script enables easy checking of the most common standard -# distributions at least. - -set -eu - -top_dir="$(dirname "$(realpath "$0")")/.." -build_in_docker="${top_dir}/misc/build-in-docker" - -build() { - local name=$1 - local cc=$2 - local cxx=$3 - local test_cc=$4 - shift 4 - local cmake_params="$*" - if command -v >/dev/null ccache; then - cmake_params="${cmake_params} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" - fi - echo "Build in Docker: $name CC=$cc CXX=$cxx TEST_CC=$test_cc CMAKE_PARAMS=\"$*\"" - ASM=$cc CC=$cc CXX=$cxx TEST_CC=$test_cc CMAKE_PARAMS="${cmake_params}" $build_in_docker $name -} - -# NAME CC CXX TEST_CC CMAKE_PARAMS - -build alma-8 gcc g++ gcc -build alma-8 clang clang++ clang - -build debian-11 gcc g++ gcc -build debian-11 clang clang++ clang - -build debian-12 gcc g++ gcc -build debian-12 clang clang++ clang - -build ubuntu-20.04 gcc g++ gcc -build ubuntu-20.04 clang clang++ clang - -build ubuntu-22.04 gcc-12 g++-12 gcc -build ubuntu-22.04 clang clang++ clang - -build ubuntu-24.04 gcc-13 g++-13 gcc -build ubuntu-24.04 gcc-14 g++-14 gcc -build ubuntu-24.04 clang clang++ clang - -build centos-7 gcc g++ gcc -build centos-7 gcc g++ clang - -build fedora-36 gcc g++ gcc -build fedora-36 clang clang++ clang - -build fedora-40 gcc g++ gcc -D DEPS=LOCAL -build fedora-40 clang clang++ clang -D DEPS=LOCAL - -build alpine-3.11 gcc g++ gcc -build alpine-3.11 gcc g++ clang - -build alpine-3.15 gcc g++ gcc -build alpine-3.15 clang clang++ clang diff --git a/misc/test-some-systems b/misc/test-some-systems new file mode 100755 index 00000000..eb39574d --- /dev/null +++ b/misc/test-some-systems @@ -0,0 +1,60 @@ +#!/bin/sh +# +# This script enables easy checking of some common standard Linux distributions. + +set -eu + +top_dir="$(dirname "$(realpath "$0")")/.." +build_in_docker="${top_dir}/misc/build-in-docker" +name_filter="${1:-}" + +build() { + local name=$1 + local cc=$2 + local cxx=$3 + local test_cc=$4 + shift 4 + local cmake_params="$*" + + echo "======================================================================" + echo "=== ${name} ${cc} ${cxx} ${test_cc} ${cmake_params}" + + if [ -n "${name_filter}" ] && [ "${name}" != "${name_filter}" ]; then + echo "Skipping due to name_filter" + return + fi + + if command -v >/dev/null ccache; then + cmake_params="${cmake_params} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" + fi + echo "Build in Docker: $name CC=$cc CXX=$cxx TEST_CC=$test_cc CMAKE_PARAMS=\"$*\"" + ASM=$cc CC=$cc CXX=$cxx TEST_CC=$test_cc CMAKE_PARAMS="${cmake_params}" $build_in_docker $name +} + +# NAME CC CXX TEST_CC CMAKE_PARAMS + +build alma-8 gcc g++ gcc -D DEPS=DOWNLOAD +build alma-8 clang clang++ clang -D DEPS=DOWNLOAD + +build alpine-3.21 gcc g++ gcc -D DEPS=DOWNLOAD +build alpine-3.21 clang clang++ clang -D DEPS=DOWNLOAD + +build debian-11 gcc g++ gcc -D DEPS=DOWNLOAD +build debian-11 clang clang++ clang -D DEPS=DOWNLOAD + +build debian-12 gcc g++ gcc -D DEPS=DOWNLOAD +build debian-12 clang clang++ clang -D DEPS=DOWNLOAD + +build fedora-42 gcc g++ gcc -D DEPS=DOWNLOAD +build fedora-42 clang clang++ clang -D DEPS=DOWNLOAD -D ENABLE_TESTING=OFF # doctest issue #900 + +build ubuntu-20.04 gcc g++ gcc -D DEPS=DOWNLOAD +build ubuntu-20.04 clang clang++ clang -D DEPS=DOWNLOAD + +build ubuntu-22.04 gcc-11 g++-11 gcc -D DEPS=DOWNLOAD +build ubuntu-22.04 gcc-12 g++-12 gcc -D DEPS=DOWNLOAD +build ubuntu-22.04 clang clang++ clang -D DEPS=DOWNLOAD + +build ubuntu-24.04 gcc-13 g++-13 gcc -D DEPS=DOWNLOAD +build ubuntu-24.04 gcc-14 g++-14 gcc -D DEPS=DOWNLOAD +build ubuntu-24.04 clang clang++ clang -D DEPS=DOWNLOAD