Skip to content

Commit 6d4326b

Browse files
gautamg795Convex, Inc.
authored and
Convex, Inc.
committed
Fix vergen git build args (#34048)
This should actually fix the VERGEN_GIT_SHA var? I forgot about arg scope in dockerfiles GitOrigin-RevId: 7af478db876cc344b7be0a7d3eca39aa6c7d66c1
1 parent 4fe7cc6 commit 6d4326b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

self-hosted/Dockerfile.backend

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# This Dockerfile builds the self-hosted version of the Convex backend
33
# It creates a minimal runtime image that can run a local Convex instance
44

5+
ARG VERGEN_GIT_SHA
6+
ARG VERGEN_GIT_COMMIT_TIMESTAMP
57

68
# cargo-chef is used to cache Rust dependencies and build artifacts
79
# It creates a recipe of our dependencies first, then builds them in a separate stage
@@ -72,11 +74,12 @@ RUN --mount=type=cache,target=/convex/target/ --mount=type=cache,target=/usr/loc
7274
COPY . .
7375

7476
# Build the convex-local-backend binary
77+
# Must redeclare these as environment variables so that they are available
7578
ARG VERGEN_GIT_SHA
7679
ARG VERGEN_GIT_COMMIT_TIMESTAMP
80+
ENV VERGEN_GIT_SHA=${VERGEN_GIT_SHA}
81+
ENV VERGEN_GIT_COMMIT_TIMESTAMP=${VERGEN_GIT_COMMIT_TIMESTAMP}
7782
RUN --mount=type=cache,target=/convex/npm-packages/common/temp/,sharing=locked --mount=type=cache,target=/convex/target/ --mount=type=cache,target=/usr/local/cargo/git/db --mount=type=cache,target=/usr/local/cargo/registry/ <<EOF
78-
export VERGEN_GIT_SHA=${VERGEN_GIT_SHA}
79-
export VERGEN_GIT_COMMIT_TIMESTAMP=${VERGEN_GIT_COMMIT_TIMESTAMP}
8083
cargo build --release -p local_backend --bin convex-local-backend
8184
cp target/release/convex-local-backend .
8285
cargo build --release -p keybroker --bin generate_key
@@ -88,6 +91,7 @@ RUN if [[ -z "$debug" ]]; then strip ./convex-local-backend; strip ./generate_ke
8891
# Final stage: Creates minimal runtime image with only necessary components
8992
# Uses Ubuntu Noble (24.04) as the base image
9093
FROM ubuntu:noble
94+
ARG VERGEN_GIT_SHA
9195
LABEL org.opencontainers.repository=https://github.com/get-convex/convex-backend
9296
LABEL org.opencontainers.image.revision=${VERGEN_GIT_SHA}
9397

0 commit comments

Comments
 (0)