From 97ac457910cb979c9abb4fe13bec2eb071f79f48 Mon Sep 17 00:00:00 2001 From: Jakob Probst Date: Sat, 11 Jul 2026 20:37:00 +0200 Subject: [PATCH] chore: remove `SHELL` instructions unknown to OCI images and use POSIX commands --- docker/Dockerfile.alpine | 10 ++++------ docker/Dockerfile.debian | 10 ++++------ docker/Dockerfile.j2 | 10 ++++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine index 59a4f8af..9e37280b 100644 --- a/docker/Dockerfile.alpine +++ b/docker/Dockerfile.alpine @@ -44,8 +44,6 @@ ARG TARGETARCH ARG TARGETVARIANT ARG TARGETPLATFORM -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - # Build time options to avoid dpkg warnings and help with reproducible builds. ENV DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ @@ -70,7 +68,7 @@ RUN echo "export CARGO_TARGET=${RUST_MUSL_CROSS_TARGET}" >> /env-cargo && \ # Output the current contents of the file cat /env-cargo -RUN source /env-cargo && \ +RUN . /env-cargo && \ rustup target add "${CARGO_TARGET}" # Copies over *only* your manifests and build files @@ -87,7 +85,7 @@ ARG FEATURES=s3,enable_mimalloc # Builds your dependencies and removes the # dummy project, except the target folder # This folder contains the compiled dependencies -RUN source /env-cargo && \ +RUN . /env-cargo && \ cargo build --features "${DB}" --features "${FEATURES}" --profile "${CARGO_PROFILE}" --target="${CARGO_TARGET}" && \ find . -not -path "./target*" -delete @@ -98,13 +96,13 @@ COPY . . ARG VW_VERSION # Builds again, this time it will be the actual source files being build -RUN source /env-cargo && \ +RUN . /env-cargo && \ # Make sure that we actually build the project by updating the src/main.rs timestamp # Also do this for build.rs to ensure the version is rechecked touch build.rs src/main.rs && \ # Create a symlink to the binary target folder to easy copy the binary in the final stage cargo build --features "${DB}" --features "${FEATURES}" --profile "${CARGO_PROFILE}" --target="${CARGO_TARGET}" && \ - if [[ "${CARGO_PROFILE}" == "dev" ]] ; then \ + if test "${CARGO_PROFILE}" = "dev"; then \ ln -vfsr "/app/target/${CARGO_TARGET}/debug" /app/target/final ; \ else \ ln -vfsr "/app/target/${CARGO_TARGET}/${CARGO_PROFILE}" /app/target/final ; \ diff --git a/docker/Dockerfile.debian b/docker/Dockerfile.debian index 873aa200..70943c65 100644 --- a/docker/Dockerfile.debian +++ b/docker/Dockerfile.debian @@ -42,8 +42,6 @@ ARG TARGETARCH ARG TARGETVARIANT ARG TARGETPLATFORM -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - # Build time options to avoid dpkg warnings and help with reproducible builds. ENV DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ @@ -80,7 +78,7 @@ RUN mkdir -pv "${CARGO_HOME}" && \ RUN USER=root cargo new --bin /app WORKDIR /app -RUN source /env-cargo && \ +RUN . /env-cargo && \ rustup target add "${CARGO_TARGET}" # Copies over *only* your manifests and build files @@ -96,7 +94,7 @@ ARG FEATURES=s3 # Builds your dependencies and removes the # dummy project, except the target folder # This folder contains the compiled dependencies -RUN source /env-cargo && \ +RUN . /env-cargo && \ # Workaround for xx related build issues # https://github.com/tonistiigi/xx/pull/108#issuecomment-3700635977 PKG_CONFIG="$(command -v "$(xx-info)-pkg-config")" xx-cargo build --features "${DB}" --features "${FEATURES}" --profile "${CARGO_PROFILE}" && \ @@ -109,7 +107,7 @@ COPY . . ARG VW_VERSION # Builds again, this time it will be the actual source files being build -RUN source /env-cargo && \ +RUN . /env-cargo && \ # Make sure that we actually build the project by updating the src/main.rs timestamp # Also do this for build.rs to ensure the version is rechecked touch build.rs src/main.rs && \ @@ -117,7 +115,7 @@ RUN source /env-cargo && \ # Workaround for xx related build issues # https://github.com/tonistiigi/xx/pull/108#issuecomment-3700635977 PKG_CONFIG="$(command -v "$(xx-info)-pkg-config")" xx-cargo build --features "${DB}" --features "${FEATURES}" --profile "${CARGO_PROFILE}" && \ - if [[ "${CARGO_PROFILE}" == "dev" ]] ; then \ + if test "${CARGO_PROFILE}" = "dev"; then \ ln -vfsr "/app/target/${CARGO_TARGET}/debug" /app/target/final ; \ else \ ln -vfsr "/app/target/${CARGO_TARGET}/${CARGO_PROFILE}" /app/target/final ; \ diff --git a/docker/Dockerfile.j2 b/docker/Dockerfile.j2 index 9903ca57..b45e7b94 100644 --- a/docker/Dockerfile.j2 +++ b/docker/Dockerfile.j2 @@ -58,8 +58,6 @@ ARG TARGETARCH ARG TARGETVARIANT ARG TARGETPLATFORM -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - # Build time options to avoid dpkg warnings and help with reproducible builds. ENV DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ @@ -111,7 +109,7 @@ RUN echo "export CARGO_TARGET=${RUST_MUSL_CROSS_TARGET}" >> /env-cargo && \ cat /env-cargo {% endif %} -RUN source /env-cargo && \ +RUN . /env-cargo && \ rustup target add "${CARGO_TARGET}" # Copies over *only* your manifests and build files @@ -132,7 +130,7 @@ ARG FEATURES=s3,enable_mimalloc # Builds your dependencies and removes the # dummy project, except the target folder # This folder contains the compiled dependencies -RUN source /env-cargo && \ +RUN . /env-cargo && \ {% if base == "debian" %} {{ xx_cargo_config() }} && \ {% elif base == "alpine" %} @@ -147,7 +145,7 @@ COPY . . ARG VW_VERSION # Builds again, this time it will be the actual source files being build -RUN source /env-cargo && \ +RUN . /env-cargo && \ # Make sure that we actually build the project by updating the src/main.rs timestamp # Also do this for build.rs to ensure the version is rechecked touch build.rs src/main.rs && \ @@ -157,7 +155,7 @@ RUN source /env-cargo && \ {% elif base == "alpine" %} cargo build --features "${DB}" --features "${FEATURES}" --profile "${CARGO_PROFILE}" --target="${CARGO_TARGET}" && \ {% endif %} - if [[ "${CARGO_PROFILE}" == "dev" ]] ; then \ + if test "${CARGO_PROFILE}" = "dev"; then \ ln -vfsr "/app/target/${CARGO_TARGET}/debug" /app/target/final ; \ else \ ln -vfsr "/app/target/${CARGO_TARGET}/${CARGO_PROFILE}" /app/target/final ; \