diff --git a/AGENTS.md b/AGENTS.md index 3325202..d6f3885 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,6 +21,8 @@ - On Rocky Linux 9, `glibc-devel`, `kernel-headers`, and `libstdc++-devel` may be installed directly or as compiler dependencies because they are foundational C/C++ platform and toolchain components. - On Alpine Linux, `musl-dev` and `linux-headers` may be installed directly or as compiler dependencies because they are foundational C/C++ platform and toolchain components. +- The `rocky9-system` image is the exception to the rules above: it deliberately installs third-party libraries and their `-dev`/`-devel` packages from the Rocky Linux 9, CRB and EPEL repositories instead of building them from source. It uses no `sources/` directory and no pinned versions. Libraries missing from those repositories (for example the Meta libraries) are skipped, not built from source. + ## Meta Libraries - Pin all Meta/Facebook ecosystem libraries to the same date-based release tag. diff --git a/README.md b/README.md index 12c618a..2073435 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Each build script automatically selects Docker or Podman: ./build-all.sh ./debian13/build.sh ./rocky9/build.sh +./rocky9-system/build.sh ./alpine3.24/build.sh ``` @@ -26,10 +27,13 @@ PREFIX=/opt/stack ./debian13/build.sh PREFIX=/opt/stack ./rocky9/build.sh ``` +The `rocky9-system` image uses the libraries shipped by Rocky Linux 9 (BaseOS, AppStream, CRB and EPEL) instead of building them from source. Libraries that those repositories do not provide, such as Folly and the other Meta libraries, are simply left out. + ## Run ```sh docker run --rm -it debian13-source-stack docker run --rm -it rocky9-source-stack +docker run --rm -it rocky9-system-stack docker run --rm -it alpine3.24-source-stack ``` diff --git a/build-all.sh b/build-all.sh index 842cf7f..b8703f3 100755 --- a/build-all.sh +++ b/build-all.sh @@ -6,4 +6,5 @@ SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) "$SCRIPT_DIR/debian13/build.sh" "$SCRIPT_DIR/rocky9/build.sh" +"$SCRIPT_DIR/rocky9-system/build.sh" "$SCRIPT_DIR/alpine3.24/build.sh" diff --git a/rocky9-system/Dockerfile b/rocky9-system/Dockerfile new file mode 100644 index 0000000..a060d5a --- /dev/null +++ b/rocky9-system/Dockerfile @@ -0,0 +1,97 @@ +FROM docker.io/library/rockylinux:9 + +# Toolchain and build tools, same as the rocky9 image. +RUN dnf install --assumeyes --enablerepo=crb \ + autoconf \ + automake \ + bzip2 \ + ca-certificates \ + cmake \ + curl-minimal \ + gcc \ + gcc-c++ \ + libasan \ + gcc-toolset-15-gcc-c++ \ + gcc-toolset-15-libasan-devel \ + git \ + libtool \ + make \ + ninja-build \ + patch \ + perl-core \ + pkgconf-pkg-config \ + rpm-build \ + tar \ + xz \ + which \ + epel-release \ + && sed \ + -e 's!^metalink=!#metalink=!g' \ + -e 's!^#baseurl=!baseurl=!g' \ + -e 's!https\?://download\.example/pub/epel!https://mirrors.ustc.edu.cn/epel!g' \ + -i /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo \ + && dnf install --assumeyes \ + makeself \ + && dnf upgrade --assumeyes \ + && dnf clean all \ + && rm -rf /var/cache/dnf + +RUN git config --global url."https://wangguofang.net/github.com/".insteadOf "https://github.com/" + +RUN test "$(cmake --version | sed -n '1s/[^0-9]*//p' | cut -d. -f2)" -ge 29 + +# Libraries come from the distribution (Rocky Linux 9, CRB and EPEL) instead of being built from +# source. A package that is not available in these repositories is skipped, not an error. +RUN dnf install --assumeyes --enablerepo=crb,epel \ + --setopt=skip_missing_names_on_install=True \ + --skip-broken \ + boost-devel \ + cyrus-sasl-devel \ + fast_float-devel \ + fmt-devel \ + folly-devel \ + gflags-devel \ + glog-devel \ + gmock-devel \ + gmp-devel \ + gnutls-devel \ + gtest-devel \ + hiredis-devel \ + jsoncpp-devel \ + json-c-devel \ + libaio-devel \ + libcurl-devel \ + libdwarf-devel \ + libevent-devel \ + libmaxminddb-devel \ + libsodium-devel \ + liburing-devel \ + libuuid-devel \ + libxml2-devel \ + libyaml-devel \ + libzstd-devel \ + log4cplus-devel \ + lz4-devel \ + magic_enum-devel \ + nettle-devel \ + numactl-devel \ + openssl-devel \ + protobuf-compiler \ + protobuf-devel \ + rapidjson-devel \ + librdkafka-devel \ + snappy-devel \ + spdlog-devel \ + thrift-devel \ + tsl-sparse-map-devel \ + xsimd-devel \ + xxhash-devel \ + zeromq-devel \ + czmq-devel \ + zlib-devel \ + libarrow-devel \ + parquet-libs-devel \ + && dnf clean all \ + && rm -rf /var/cache/dnf + +CMD ["/bin/bash"] diff --git a/rocky9-system/build.sh b/rocky9-system/build.sh new file mode 100755 index 0000000..934400b --- /dev/null +++ b/rocky9-system/build.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -eu + +IMAGE_NAME="${IMAGE_NAME:-rocky9-system-stack}" +SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) + +if command -v podman >/dev/null 2>&1; then + ENGINE=podman +elif command -v docker >/dev/null 2>&1; then + ENGINE=docker +else + echo "Error: Podman or Docker is required." >&2 + exit 1 +fi +ENGINE="${CONTAINER_ENGINE:-$ENGINE}" + +echo "Building image $IMAGE_NAME with $ENGINE ..." +exec "$ENGINE" build --tag "$IMAGE_NAME" "$SCRIPT_DIR"