From 5f0422f3f037a8743d030c7b174b22157ee475ee Mon Sep 17 00:00:00 2001 From: Guofang Date: Mon, 26 Oct 2026 14:07:02 +0800 Subject: [PATCH] Import rocky9 source archives via the sources build context Co-Authored-By: Claude Sonnet 5.5 --- rocky9/Dockerfile | 374 +++++++++++++++++----------------------------- rocky9/build.sh | 6 +- 2 files changed, 145 insertions(+), 235 deletions(-) diff --git a/rocky9/Dockerfile b/rocky9/Dockerfile index 2b65058..f499404 100644 --- a/rocky9/Dockerfile +++ b/rocky9/Dockerfile @@ -48,11 +48,9 @@ RUN export RUSTUP_DIST_SERVER="https://mirrors.ustc.edu.cn/rust-static" \ && "$HOME/.cargo/bin/rustup" toolchain install 1.98.0 --profile minimal \ && ln --symbolic "$HOME"/.cargo/bin/* /usr/local/bin/ -RUN curl --fail --location --output boost.tar.bz2 \ - https://mirrors.aliyun.com/blfs/conglomeration/boost/boost_1_83_0.tar.bz2 \ - && mkdir src \ - && tar --extract --bzip2 --file=boost.tar.bz2 --directory=src --strip-components=1 \ - && rm boost.tar.bz2 \ +RUN --mount=type=bind,from=sources,source=boost_1_83_0.tar.bz2,target=/tmp/boost.tar.bz2 \ + mkdir src \ + && tar --extract --bzip2 --file=/tmp/boost.tar.bz2 --directory=src --strip-components=1 \ && cd src \ && ./bootstrap.sh --prefix=/usr/local --libdir=/usr/local/lib64 \ && ./b2 --jobs="$(nproc)" \ @@ -76,11 +74,9 @@ RUN curl --fail --location --output boost.tar.bz2 \ && cd .. \ && rm -rf src -RUN curl --fail --location --output openssl.tar.gz \ - https://wangguofang.net/github.com/openssl/openssl/archive/openssl-3.0.15.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=openssl.tar.gz --directory=src --strip-components=1 \ - && rm openssl.tar.gz \ +RUN --mount=type=bind,from=sources,source=openssl-openssl-3.0.15.tar.gz,target=/tmp/openssl.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/openssl.tar.gz --directory=src --strip-components=1 \ && cd src \ && ./Configure --prefix=/usr/local no-shared no-tests -fPIC \ && make --jobs="$(nproc)" \ @@ -89,11 +85,9 @@ RUN curl --fail --location --output openssl.tar.gz \ && rm -rf src COPY libevent-lib64-install.patch /tmp/ -RUN curl --fail --location --output libevent.tar.gz \ - https://wangguofang.net/github.com/libevent/libevent/archive/release-2.1.12-stable.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libevent.tar.gz --directory=src --strip-components=1 \ - && rm libevent.tar.gz \ +RUN --mount=type=bind,from=sources,source=libevent-release-2.1.12-stable.tar.gz,target=/tmp/libevent.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libevent.tar.gz --directory=src --strip-components=1 \ && git -C src apply /tmp/libevent-lib64-install.patch \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ @@ -105,11 +99,9 @@ RUN curl --fail --location --output libevent.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src /tmp/libevent-lib64-install.patch -RUN curl --fail --location --output zstd.tar.gz \ - https://wangguofang.net/github.com/facebook/zstd/archive/v1.5.7.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=zstd.tar.gz --directory=src --strip-components=1 \ - && rm zstd.tar.gz \ +RUN --mount=type=bind,from=sources,source=zstd-v1.5.7.tar.gz,target=/tmp/zstd.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/zstd.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src/build/cmake -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DZSTD_BUILD_CONTRIB=OFF \ @@ -120,11 +112,9 @@ RUN curl --fail --location --output zstd.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output zlib.tar.gz \ - https://wangguofang.net/github.com/madler/zlib/archive/v1.3.1.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=zlib.tar.gz --directory=src --strip-components=1 \ - && rm zlib.tar.gz \ +RUN --mount=type=bind,from=sources,source=zlib-v1.3.1.tar.gz,target=/tmp/zlib.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/zlib.tar.gz --directory=src --strip-components=1 \ && cd src \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --static \ && make --jobs="$(nproc)" \ @@ -132,11 +122,9 @@ RUN curl --fail --location --output zlib.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output protobuf.tar.gz \ - https://wangguofang.net/github.com/protocolbuffers/protobuf/archive/v3.21.12.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=protobuf.tar.gz --directory=src --strip-components=1 \ - && rm protobuf.tar.gz \ +RUN --mount=type=bind,from=sources,source=protobuf-v3.21.12.tar.gz,target=/tmp/protobuf.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/protobuf.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_BUILD_SHARED_LIBS=OFF \ -Dprotobuf_WITH_ZLIB=ON \ @@ -156,11 +144,9 @@ RUN git clone --branch=REL_2_0_5 --depth=1 https://github.com/log4cplus/log4cplu && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output fmt.tar.gz \ - https://wangguofang.net/github.com/fmtlib/fmt/archive/12.2.0.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=fmt.tar.gz --directory=src --strip-components=1 \ - && rm fmt.tar.gz \ +RUN --mount=type=bind,from=sources,source=fmt-12.2.0.tar.gz,target=/tmp/fmt.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/fmt.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ @@ -169,11 +155,9 @@ RUN curl --fail --location --output fmt.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output spdlog.tar.gz \ - https://wangguofang.net/github.com/gabime/spdlog/archive/v1.17.0.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=spdlog.tar.gz --directory=src --strip-components=1 \ - && rm spdlog.tar.gz \ +RUN --mount=type=bind,from=sources,source=spdlog-v1.17.0.tar.gz,target=/tmp/spdlog.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/spdlog.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ @@ -184,11 +168,9 @@ RUN curl --fail --location --output spdlog.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output magic_enum.tar.gz \ - https://wangguofang.net/github.com/Neargye/magic_enum/archive/v0.9.8.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=magic_enum.tar.gz --directory=src --strip-components=1 \ - && rm magic_enum.tar.gz \ +RUN --mount=type=bind,from=sources,source=magic_enum-v0.9.8.tar.gz,target=/tmp/magic_enum.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/magic_enum.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DMAGIC_ENUM_OPT_BUILD_EXAMPLES=OFF \ -DMAGIC_ENUM_OPT_BUILD_TESTS=OFF \ @@ -196,11 +178,9 @@ RUN curl --fail --location --output magic_enum.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output fast_float.tar.gz \ - https://wangguofang.net/github.com/fastfloat/fast_float/archive/v8.2.10.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=fast_float.tar.gz --directory=src --strip-components=1 \ - && rm fast_float.tar.gz \ +RUN --mount=type=bind,from=sources,source=fast_float-v8.2.10.tar.gz,target=/tmp/fast_float.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/fast_float.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DFASTFLOAT_BENCHMARKS=OFF \ -DFASTFLOAT_INSTALL=ON \ @@ -208,20 +188,16 @@ RUN curl --fail --location --output fast_float.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output sparse-map.tar.gz \ - https://wangguofang.net/github.com/Tessil/sparse-map/archive/v0.7.0.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=sparse-map.tar.gz --directory=src --strip-components=1 \ - && rm sparse-map.tar.gz \ +RUN --mount=type=bind,from=sources,source=sparse-map-v0.7.0.tar.gz,target=/tmp/sparse-map.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/sparse-map.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output gflags.tar.gz \ - https://wangguofang.net/github.com/gflags/gflags/archive/v2.3.1.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=gflags.tar.gz --directory=src --strip-components=1 \ - && rm gflags.tar.gz \ +RUN --mount=type=bind,from=sources,source=gflags-v2.3.1.tar.gz,target=/tmp/gflags.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/gflags.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_STATIC_LIBS=ON \ @@ -235,11 +211,9 @@ RUN curl --fail --location --output gflags.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output glog.tar.gz \ - https://wangguofang.net/github.com/google/glog/archive/v0.7.1.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=glog.tar.gz --directory=src --strip-components=1 \ - && rm glog.tar.gz \ +RUN --mount=type=bind,from=sources,source=glog-v0.7.1.tar.gz,target=/tmp/glog.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/glog.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_TESTING=OFF \ @@ -251,11 +225,9 @@ RUN curl --fail --location --output glog.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output liburing.tar.gz \ - https://wangguofang.net/github.com/axboe/liburing/archive/liburing-2.15.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=liburing.tar.gz --directory=src --strip-components=1 \ - && rm liburing.tar.gz \ +RUN --mount=type=bind,from=sources,source=liburing-liburing-2.15.tar.gz,target=/tmp/liburing.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/liburing.tar.gz --directory=src --strip-components=1 \ && cd src \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --libdevdir=/usr/local/lib64 \ && make --jobs="$(nproc)" ENABLE_SHARED=0 library \ @@ -263,20 +235,16 @@ RUN curl --fail --location --output liburing.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output libaio.tar.gz \ - https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/liba/libaio/libaio_0.3.113.orig.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libaio.tar.gz --directory=src --strip-components=1 \ - && rm libaio.tar.gz \ +RUN --mount=type=bind,from=sources,source=libaio_0.3.113.orig.tar.gz,target=/tmp/libaio.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libaio.tar.gz --directory=src --strip-components=1 \ && make --directory=src --jobs="$(nproc)" ENABLE_SHARED=0 \ && make --directory=src ENABLE_SHARED=0 prefix=/usr/local libdir=/usr/local/lib64 install \ && rm -rf src -RUN curl --fail --location --output libdwarf-code.tar.gz \ - https://wangguofang.net/github.com/davea42/libdwarf-code/archive/v2.3.2.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libdwarf-code.tar.gz --directory=src --strip-components=1 \ - && rm libdwarf-code.tar.gz \ +RUN --mount=type=bind,from=sources,source=libdwarf-code-v2.3.2.tar.gz,target=/tmp/libdwarf-code.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libdwarf-code.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_DWARFDUMP=OFF \ -DBUILD_DWARFEXAMPLE=OFF \ @@ -289,11 +257,9 @@ RUN curl --fail --location --output libdwarf-code.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output libsodium.tar.gz \ - https://wangguofang.net/github.com/jedisct1/libsodium/archive/1.0.20-RELEASE.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libsodium.tar.gz --directory=src --strip-components=1 \ - && rm libsodium.tar.gz \ +RUN --mount=type=bind,from=sources,source=libsodium-1.0.20-RELEASE.tar.gz,target=/tmp/libsodium.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libsodium.tar.gz --directory=src --strip-components=1 \ && cd src \ && ./autogen.sh \ && ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --disable-shared --enable-static --with-pic \ @@ -302,11 +268,9 @@ RUN curl --fail --location --output libsodium.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output xxHash.tar.gz \ - https://wangguofang.net/github.com/Cyan4973/xxHash/archive/v0.8.3.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=xxHash.tar.gz --directory=src --strip-components=1 \ - && rm xxHash.tar.gz \ +RUN --mount=type=bind,from=sources,source=xxHash-v0.8.3.tar.gz,target=/tmp/xxHash.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/xxHash.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src/cmake_unofficial -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ @@ -314,11 +278,9 @@ RUN curl --fail --location --output xxHash.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output googletest.tar.gz \ - https://wangguofang.net/github.com/google/googletest/archive/v1.17.0.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=googletest.tar.gz --directory=src --strip-components=1 \ - && rm googletest.tar.gz \ +RUN --mount=type=bind,from=sources,source=googletest-v1.17.0.tar.gz,target=/tmp/googletest.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/googletest.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_GMOCK=ON \ -DBUILD_SHARED_LIBS=OFF \ @@ -329,11 +291,9 @@ RUN curl --fail --location --output googletest.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output numactl.tar.gz \ - https://wangguofang.net/github.com/numactl/numactl/archive/v2.0.19.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=numactl.tar.gz --directory=src --strip-components=1 \ - && rm numactl.tar.gz \ +RUN --mount=type=bind,from=sources,source=numactl-v2.0.19.tar.gz,target=/tmp/numactl.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/numactl.tar.gz --directory=src --strip-components=1 \ && cd src \ && ./autogen.sh \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --disable-shared --enable-static \ @@ -342,11 +302,9 @@ RUN curl --fail --location --output numactl.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output folly.tar.gz \ - https://wangguofang.net/github.com/facebook/folly/archive/v2026.08.03.00.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=folly.tar.gz --directory=src --strip-components=1 \ - && rm folly.tar.gz \ +RUN --mount=type=bind,from=sources,source=folly-v2026.08.03.00.tar.gz,target=/tmp/folly.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/folly.tar.gz --directory=src --strip-components=1 \ && CXXFLAGS="-DGLOG_USE_GLOG_EXPORT" \ cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBOOST_LINK_STATIC=ON \ @@ -360,11 +318,9 @@ RUN curl --fail --location --output folly.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output fizz.tar.gz \ - https://wangguofang.net/github.com/facebookincubator/fizz/archive/v2026.08.03.00.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=fizz.tar.gz --directory=src --strip-components=1 \ - && rm fizz.tar.gz \ +RUN --mount=type=bind,from=sources,source=fizz-v2026.08.03.00.tar.gz,target=/tmp/fizz.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/fizz.tar.gz --directory=src --strip-components=1 \ && CXXFLAGS="-DGLOG_USE_GLOG_EXPORT" \ cmake -G Ninja -S src/fizz -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_EXAMPLES=OFF \ @@ -377,11 +333,9 @@ RUN curl --fail --location --output fizz.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output wangle.tar.gz \ - https://wangguofang.net/github.com/facebook/wangle/archive/v2026.08.03.00.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=wangle.tar.gz --directory=src --strip-components=1 \ - && rm wangle.tar.gz \ +RUN --mount=type=bind,from=sources,source=wangle-v2026.08.03.00.tar.gz,target=/tmp/wangle.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/wangle.tar.gz --directory=src --strip-components=1 \ && CXXFLAGS="-DGLOG_USE_GLOG_EXPORT" \ cmake -G Ninja -S src/wangle -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_EXAMPLES=OFF \ @@ -393,11 +347,9 @@ RUN curl --fail --location --output wangle.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output mvfst.tar.gz \ - https://wangguofang.net/github.com/facebook/mvfst/archive/v2026.08.03.00.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=mvfst.tar.gz --directory=src --strip-components=1 \ - && rm mvfst.tar.gz \ +RUN --mount=type=bind,from=sources,source=mvfst-v2026.08.03.00.tar.gz,target=/tmp/mvfst.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/mvfst.tar.gz --directory=src --strip-components=1 \ && CXXFLAGS="-DGLOG_USE_GLOG_EXPORT" \ cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SAMPLES=OFF \ @@ -409,11 +361,9 @@ RUN curl --fail --location --output mvfst.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output fbthrift.tar.gz \ - https://wangguofang.net/github.com/facebook/fbthrift/archive/v2026.08.03.00.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=fbthrift.tar.gz --directory=src --strip-components=1 \ - && rm fbthrift.tar.gz \ +RUN --mount=type=bind,from=sources,source=fbthrift-v2026.08.03.00.tar.gz,target=/tmp/fbthrift.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/fbthrift.tar.gz --directory=src --strip-components=1 \ && CXXFLAGS="-DGLOG_USE_GLOG_EXPORT" \ cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ @@ -429,11 +379,9 @@ RUN curl --fail --location --output fbthrift.tar.gz \ && rm -rf build src COPY cachelib-optional-interface.patch /tmp/ -RUN curl --fail --location --output CacheLib.tar.gz \ - https://wangguofang.net/github.com/facebook/CacheLib/archive/v2026.08.03.00.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=CacheLib.tar.gz --directory=src --strip-components=1 \ - && rm CacheLib.tar.gz \ +RUN --mount=type=bind,from=sources,source=CacheLib-v2026.08.03.00.tar.gz,target=/tmp/CacheLib.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/CacheLib.tar.gz --directory=src --strip-components=1 \ && git -C src apply /tmp/cachelib-optional-interface.patch \ && CXXFLAGS="-DGLOG_USE_GLOG_EXPORT" \ cmake -G Ninja -S src/cachelib -B build -DCMAKE_BUILD_TYPE=Release \ @@ -447,11 +395,9 @@ RUN curl --fail --location --output CacheLib.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src /tmp/cachelib-optional-interface.patch -RUN curl --fail --location --output util-linux.tar.xz \ - https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.42/util-linux-2.42.2.tar.xz \ - && mkdir src \ - && tar --extract --xz --file=util-linux.tar.xz --directory=src --strip-components=1 \ - && rm util-linux.tar.xz \ +RUN --mount=type=bind,from=sources,source=util-linux-2.42.2.tar.xz,target=/tmp/util-linux.tar.xz \ + mkdir src \ + && tar --extract --xz --file=/tmp/util-linux.tar.xz --directory=src --strip-components=1 \ && cd src \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 \ --disable-all-programs \ @@ -466,11 +412,9 @@ RUN curl --fail --location --output util-linux.tar.xz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output libzmq.tar.gz \ - https://wangguofang.net/github.com/zeromq/libzmq/archive/v4.3.5.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libzmq.tar.gz --directory=src --strip-components=1 \ - && rm libzmq.tar.gz \ +RUN --mount=type=bind,from=sources,source=libzmq-v4.3.5.tar.gz,target=/tmp/libzmq.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libzmq.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED=OFF \ -DBUILD_STATIC=ON \ @@ -486,11 +430,9 @@ RUN curl --fail --location --output libzmq.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output czmq.tar.gz \ - https://wangguofang.net/github.com/zeromq/czmq/archive/v4.2.1.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=czmq.tar.gz --directory=src --strip-components=1 \ - && rm czmq.tar.gz \ +RUN --mount=type=bind,from=sources,source=czmq-v4.2.1.tar.gz,target=/tmp/czmq.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/czmq.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCZMQ_BUILD_SHARED=OFF \ @@ -506,11 +448,9 @@ RUN curl --fail --location --output czmq.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output jsoncpp.tar.gz \ - https://wangguofang.net/github.com/open-source-parsers/jsoncpp/archive/1.9.8.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=jsoncpp.tar.gz --directory=src --strip-components=1 \ - && rm jsoncpp.tar.gz \ +RUN --mount=type=bind,from=sources,source=jsoncpp-1.9.8.tar.gz,target=/tmp/jsoncpp.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/jsoncpp.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_OBJECT_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \ @@ -522,11 +462,9 @@ RUN curl --fail --location --output jsoncpp.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output librdkafka.tar.gz \ - https://wangguofang.net/github.com/confluentinc/librdkafka/archive/v2.15.0.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=librdkafka.tar.gz --directory=src --strip-components=1 \ - && rm librdkafka.tar.gz \ +RUN --mount=type=bind,from=sources,source=librdkafka-v2.15.0.tar.gz,target=/tmp/librdkafka.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/librdkafka.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DENABLE_LZ4_EXT=OFF \ @@ -542,11 +480,9 @@ RUN curl --fail --location --output librdkafka.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output json-c.tar.gz \ - https://wangguofang.net/github.com/json-c/json-c/archive/json-c-0.19-20260627.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=json-c.tar.gz --directory=src --strip-components=1 \ - && rm json-c.tar.gz \ +RUN --mount=type=bind,from=sources,source=json-c-json-c-0.19-20260627.tar.gz,target=/tmp/json-c.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/json-c.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_APPS=OFF \ -DBUILD_SHARED_LIBS=OFF \ @@ -558,11 +494,9 @@ RUN curl --fail --location --output json-c.tar.gz \ && rm -rf build src COPY rapidjson-generic-string-ref-assignment.patch /tmp/ -RUN curl --fail --location --output rapidjson.tar.gz \ - https://wangguofang.net/github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=rapidjson.tar.gz --directory=src --strip-components=1 \ - && rm rapidjson.tar.gz \ +RUN --mount=type=bind,from=sources,source=rapidjson-v1.1.0.tar.gz,target=/tmp/rapidjson.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/rapidjson.tar.gz --directory=src --strip-components=1 \ && git -C src apply /tmp/rapidjson-generic-string-ref-assignment.patch \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DLIB_INSTALL_DIR=/usr/local/lib64 \ @@ -572,11 +506,9 @@ RUN curl --fail --location --output rapidjson.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src /tmp/rapidjson-generic-string-ref-assignment.patch -RUN curl --fail --location --output curl.tar.gz \ - https://wangguofang.net/github.com/curl/curl/archive/curl-8_21_0.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=curl.tar.gz --directory=src --strip-components=1 \ - && rm curl.tar.gz \ +RUN --mount=type=bind,from=sources,source=curl-curl-8_21_0.tar.gz,target=/tmp/curl.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/curl.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_CURL_EXE=OFF \ -DBUILD_EXAMPLES=OFF \ @@ -600,11 +532,9 @@ RUN curl --fail --location --output curl.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output hiredis.tar.gz \ - https://wangguofang.net/github.com/redis/hiredis/archive/v1.4.1.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=hiredis.tar.gz --directory=src --strip-components=1 \ - && rm hiredis.tar.gz \ +RUN --mount=type=bind,from=sources,source=hiredis-v1.4.1.tar.gz,target=/tmp/hiredis.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/hiredis.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ @@ -616,11 +546,9 @@ RUN curl --fail --location --output hiredis.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output gmp.tar.xz \ - https://mirrors.ustc.edu.cn/gnu/gmp/gmp-6.3.0.tar.xz \ - && mkdir src \ - && tar --extract --xz --file=gmp.tar.xz --directory=src --strip-components=1 \ - && rm gmp.tar.xz \ +RUN --mount=type=bind,from=sources,source=gmp-6.3.0.tar.xz,target=/tmp/gmp.tar.xz \ + mkdir src \ + && tar --extract --xz --file=/tmp/gmp.tar.xz --directory=src --strip-components=1 \ && cd src \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --disable-shared --enable-static \ && make --jobs="$(nproc)" \ @@ -628,11 +556,9 @@ RUN curl --fail --location --output gmp.tar.xz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output nettle.tar.gz \ - https://mirrors.ustc.edu.cn/gnu/nettle/nettle-3.10.2.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=nettle.tar.gz --directory=src --strip-components=1 \ - && rm nettle.tar.gz \ +RUN --mount=type=bind,from=sources,source=nettle-3.10.2.tar.gz,target=/tmp/nettle.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/nettle.tar.gz --directory=src --strip-components=1 \ && cd src \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 \ --disable-documentation \ @@ -643,11 +569,9 @@ RUN curl --fail --location --output nettle.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output gnutls.tar.xz \ - https://mirrors.dotsrc.org/gcrypt/gnutls/v3.8/gnutls-3.8.13.tar.xz \ - && mkdir src \ - && tar --extract --xz --file=gnutls.tar.xz --directory=src --strip-components=1 \ - && rm gnutls.tar.xz \ +RUN --mount=type=bind,from=sources,source=gnutls-3.8.13.tar.xz,target=/tmp/gnutls.tar.xz \ + mkdir src \ + && tar --extract --xz --file=/tmp/gnutls.tar.xz --directory=src --strip-components=1 \ && cd src \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 \ --with-included-libtasn1 \ @@ -672,11 +596,9 @@ RUN curl --fail --location --output gnutls.tar.xz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output libmaxminddb.tar.gz \ - https://wangguofang.net/github.com/maxmind/libmaxminddb/archive/1.13.3.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libmaxminddb.tar.gz --directory=src --strip-components=1 \ - && rm libmaxminddb.tar.gz \ +RUN --mount=type=bind,from=sources,source=libmaxminddb-1.13.3.tar.gz,target=/tmp/libmaxminddb.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libmaxminddb.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_TESTING=OFF \ @@ -685,11 +607,9 @@ RUN curl --fail --location --output libmaxminddb.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output libyaml.tar.gz \ - https://wangguofang.net/github.com/yaml/libyaml/archive/0.2.5.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libyaml.tar.gz --directory=src --strip-components=1 \ - && rm libyaml.tar.gz \ +RUN --mount=type=bind,from=sources,source=libyaml-0.2.5.tar.gz,target=/tmp/libyaml.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libyaml.tar.gz --directory=src --strip-components=1 \ && cd src \ && ./bootstrap \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --disable-shared --enable-static \ @@ -698,11 +618,9 @@ RUN curl --fail --location --output libyaml.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output libxml2.tar.gz \ - https://wangguofang.net/github.com/GNOME/libxml2/archive/refs/tags/v2.15.3.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libxml2.tar.gz --directory=src --strip-components=1 \ - && rm libxml2.tar.gz \ +RUN --mount=type=bind,from=sources,source=libxml2-v2.15.3.tar.gz,target=/tmp/libxml2.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libxml2.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ @@ -716,11 +634,9 @@ RUN curl --fail --location --output libxml2.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output redis-plus-plus.tar.gz \ - https://wangguofang.net/github.com/sewenew/redis-plus-plus/archive/1.3.15.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=redis-plus-plus.tar.gz --directory=src --strip-components=1 \ - && rm redis-plus-plus.tar.gz \ +RUN --mount=type=bind,from=sources,source=redis-plus-plus-1.3.15.tar.gz,target=/tmp/redis-plus-plus.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/redis-plus-plus.tar.gz --directory=src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DREDIS_PLUS_PLUS_BUILD_SHARED=OFF \ -DREDIS_PLUS_PLUS_BUILD_STATIC=ON \ @@ -729,11 +645,9 @@ RUN curl --fail --location --output redis-plus-plus.tar.gz \ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN curl --fail --location --output libunwind.tar.gz \ - https://wangguofang.net/github.com/libunwind/libunwind/archive/v1.8.3.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libunwind.tar.gz --directory=src --strip-components=1 \ - && rm libunwind.tar.gz \ +RUN --mount=type=bind,from=sources,source=libunwind-v1.8.3.tar.gz,target=/tmp/libunwind.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libunwind.tar.gz --directory=src --strip-components=1 \ && cd src \ && autoreconf --install \ && CFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 \ @@ -748,11 +662,9 @@ RUN curl --fail --location --output libunwind.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output jemalloc.tar.gz \ - https://wangguofang.net/github.com/jemalloc/jemalloc/archive/5.3.1.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=jemalloc.tar.gz --directory=src --strip-components=1 \ - && rm jemalloc.tar.gz \ +RUN --mount=type=bind,from=sources,source=jemalloc-5.3.1.tar.gz,target=/tmp/jemalloc.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/jemalloc.tar.gz --directory=src --strip-components=1 \ && cd src \ && ./autogen.sh \ && CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --prefix=/usr/local --libdir=/usr/local/lib64 \ @@ -766,26 +678,20 @@ RUN curl --fail --location --output jemalloc.tar.gz \ && cd .. \ && rm -rf src -RUN curl --fail --location --output libproxyprotocol.tar.gz \ - https://wangguofang.net/github.com/kosmas-valianos/libproxyprotocol/archive/v1.3.3.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=libproxyprotocol.tar.gz --directory=src --strip-components=1 \ - && rm libproxyprotocol.tar.gz \ +RUN --mount=type=bind,from=sources,source=libproxyprotocol-v1.3.3.tar.gz,target=/tmp/libproxyprotocol.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/libproxyprotocol.tar.gz --directory=src --strip-components=1 \ && gcc -fPIC -c -o src/src/proxy_protocol.o src/src/proxy_protocol.c \ && ar rcs /usr/local/lib64/libproxyprotocol.a src/src/proxy_protocol.o \ && cp src/src/proxy_protocol.h /usr/local/include/ \ && rm -rf src -RUN curl --fail --location --output duckdb.tar.gz \ - https://wangguofang.net/github.com/duckdb/duckdb/archive/v1.5.6.tar.gz \ - && mkdir src \ - && tar --extract --gzip --file=duckdb.tar.gz --directory=src --strip-components=1 \ - && rm duckdb.tar.gz \ - && curl --fail --location --output duckdb-ui.tar.gz \ - https://wangguofang.net/github.com/duckdb/duckdb-ui/archive/0628932f74b1e2e9eaf68a05b22d737455541dca.tar.gz \ +RUN --mount=type=bind,from=sources,source=duckdb-v1.5.6.tar.gz,target=/tmp/duckdb.tar.gz \ + --mount=type=bind,from=sources,source=duckdb-ui-0628932f74b1e2e9eaf68a05b22d737455541dca.tar.gz,target=/tmp/duckdb-ui.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/duckdb.tar.gz --directory=src --strip-components=1 \ && mkdir ui-src \ - && tar --extract --gzip --file=duckdb-ui.tar.gz --directory=ui-src --strip-components=1 \ - && rm duckdb-ui.tar.gz \ + && tar --extract --gzip --file=/tmp/duckdb-ui.tar.gz --directory=ui-src --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DDUCKDB_EXTENSION_CONFIGS="$PWD/ui-src/extension_config.cmake" \ -DBUILD_SHARED_LIBS=OFF \ diff --git a/rocky9/build.sh b/rocky9/build.sh index 498bf81..8018382 100755 --- a/rocky9/build.sh +++ b/rocky9/build.sh @@ -4,11 +4,15 @@ set -eu IMAGE_NAME="${IMAGE_NAME:-rocky9-source-stack}" SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +SOURCES_DIR="${SOURCES_DIR:-$SCRIPT_DIR/../sources}" +FETCH_SCRIPT="$SCRIPT_DIR/../fetch-sources.sh" if ! command -v podman >/dev/null 2>&1; then echo "Error: Podman is required." >&2 exit 1 fi +SOURCES_DIR="$SOURCES_DIR" "$FETCH_SCRIPT" + echo "Building image $IMAGE_NAME with podman ..." -exec podman build --tag "$IMAGE_NAME" "$SCRIPT_DIR" +exec podman build --build-context sources="$SOURCES_DIR" --tag "$IMAGE_NAME" "$SCRIPT_DIR"