diff --git a/README.md b/README.md index 8eaac8c..7d2b4f2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Use environment variables to select the container engine or override image names CONTAINER_ENGINE=podman IMAGE_NAME=my-build-env ./rocky9/build.sh ``` -The Debian 13 and Rocky Linux 9 images install every library under `/usr/local` by default. Set `PREFIX` to install them elsewhere; the build environment variables (`PATH`, `PKG_CONFIG_PATH`, `CMAKE_PREFIX_PATH`, `CMAKE_INSTALL_PREFIX`, and so on) follow it. The Alpine image does not support `PREFIX`. +The Debian 13 and Rocky Linux 9 images install every library under `/usr/local` by default. Set `PREFIX` to install them elsewhere; the build environment variables (`PATH`, `PKG_CONFIG_PATH`, `CMAKE_PREFIX_PATH`, `CMAKE_INSTALL_PREFIX`, and so on) follow it. Rust is a build tool rather than a library, so it always lives under `/usr/local` and is not affected by `PREFIX`. The Alpine image does not support `PREFIX`. ```sh PREFIX=/opt/stack ./debian13/build.sh diff --git a/debian13/Dockerfile b/debian13/Dockerfile index b14c78c..171cbc2 100644 --- a/debian13/Dockerfile +++ b/debian13/Dockerfile @@ -38,10 +38,11 @@ ENV PATH=${PREFIX}/bin:${PATH} \ RUN test "$(cmake --version | sed -n '1s/[^0-9]*//p' | cut -d. -f2)" -ge 29 +# Rust is a build tool, not a library, so it is installed under /usr/local regardless of ${PREFIX}. RUN --mount=type=bind,from=sources,source=rust,target=/tmp/rust \ mkdir rust-src \ && tar -xJf "/tmp/rust/rust-1.99.1-$(uname -m)-unknown-linux-gnu.tar.xz" -C rust-src --strip-components=1 \ - && rust-src/install.sh --prefix=${PREFIX} --without=rust-docs \ + && rust-src/install.sh --prefix=/usr/local --without=rust-docs \ && rm -rf rust-src RUN --mount=type=bind,from=sources,source=boost_1_83_0.tar.bz2,target=/tmp/boost.tar.bz2 \ diff --git a/rocky9/Dockerfile b/rocky9/Dockerfile index 3ce15c1..ff35ab6 100644 --- a/rocky9/Dockerfile +++ b/rocky9/Dockerfile @@ -52,10 +52,11 @@ ENV PATH=${PREFIX}/bin:${PATH} \ RUN test "$(cmake --version | sed -n '1s/[^0-9]*//p' | cut -d. -f2)" -ge 29 +# Rust is a build tool, not a library, so it is installed under /usr/local regardless of ${PREFIX}. RUN --mount=type=bind,from=sources,source=rust,target=/tmp/rust \ mkdir rust-src \ && tar -xJf "/tmp/rust/rust-1.99.1-$(uname -m)-unknown-linux-gnu.tar.xz" -C rust-src --strip-components=1 \ - && rust-src/install.sh --prefix=${PREFIX} --without=rust-docs \ + && rust-src/install.sh --prefix=/usr/local --without=rust-docs \ && rm -rf rust-src RUN --mount=type=bind,from=sources,source=boost_1_83_0.tar.bz2,target=/tmp/boost.tar.bz2 \