Skip to content

Commit 15557e5

Browse files
committed
fix(docker): propagate OPENSHELL_IMAGE_TAG to cross-compile Dockerfiles
Three Dockerfiles that cross-compile CLI binaries via Docker were missing ARG OPENSHELL_IMAGE_TAG declarations. The CI workflows and build scripts already pass this as a --build-arg, but without the ARG declaration Docker silently drops it. This caused Rust's option_env!("OPENSHELL_IMAGE_TAG") to resolve to None at compile time, falling back to "dev" for DEFAULT_IMAGE_TAG in stable release binaries. Affected artifacts: - macOS CLI binary (Dockerfile.cli-macos) - Linux Python wheels (Dockerfile.python-wheels) - macOS Python wheels (Dockerfile.python-wheels-macos) The Linux CLI binary was not affected because it builds directly in the CI container where OPENSHELL_IMAGE_TAG is set as a real env var.
1 parent ef196db commit 15557e5

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

deploy/docker/Dockerfile.cli-macos

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ RUN touch crates/openshell-cli/src/main.rs \
103103
crates/openshell-core/build.rs \
104104
proto/*.proto
105105

106-
# Declare version ARG here (not earlier) so the git-hash-bearing value does not
106+
# Declare version ARGs here (not earlier) so the git-hash-bearing values do not
107107
# invalidate the expensive dependency-build layers above on every commit.
108108
ARG OPENSHELL_CARGO_VERSION
109+
ARG OPENSHELL_IMAGE_TAG
109110
RUN --mount=type=cache,id=cargo-registry-cli-macos,sharing=locked,target=/root/.cargo/registry \
110111
--mount=type=cache,id=cargo-git-cli-macos,sharing=locked,target=/root/.cargo/git \
111112
--mount=type=cache,id=cargo-target-cli-macos-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \

deploy/docker/Dockerfile.python-wheels

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ RUN touch crates/openshell-cli/src/main.rs \
8484
crates/openshell-core/build.rs \
8585
proto/*.proto
8686

87-
# Declare version ARG here (not earlier) so the git-hash-bearing value does not
87+
# Declare version ARGs here (not earlier) so the git-hash-bearing values do not
8888
# invalidate the expensive dependency-build layers above on every commit.
8989
ARG OPENSHELL_CARGO_VERSION
90+
ARG OPENSHELL_IMAGE_TAG
9091
RUN --mount=type=cache,id=cargo-registry-python-wheels-${TARGETARCH},sharing=locked,target=/root/.cargo/registry \
9192
--mount=type=cache,id=cargo-git-python-wheels-${TARGETARCH},sharing=locked,target=/root/.cargo/git \
9293
--mount=type=cache,id=cargo-target-python-wheels-${TARGETARCH}-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \

deploy/docker/Dockerfile.python-wheels-macos

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ RUN touch crates/openshell-cli/src/main.rs \
9191
crates/openshell-core/build.rs \
9292
proto/*.proto
9393

94-
# Declare version ARG here (not earlier) so the git-hash-bearing value does not
94+
# Declare version ARGs here (not earlier) so the git-hash-bearing values do not
9595
# invalidate the expensive dependency-build layers above on every commit.
9696
ARG OPENSHELL_CARGO_VERSION
97+
ARG OPENSHELL_IMAGE_TAG
9798
RUN --mount=type=cache,id=cargo-registry-python-wheels-macos-${TARGETARCH},sharing=locked,target=/root/.cargo/registry \
9899
--mount=type=cache,id=cargo-git-python-wheels-macos-${TARGETARCH},sharing=locked,target=/root/.cargo/git \
99100
--mount=type=cache,id=cargo-target-python-wheels-macos-${TARGETARCH}-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \

0 commit comments

Comments
 (0)