diff --git a/Dockerfile b/Dockerfile
index d07510868de0a9b9aa0e71ab0d12176259d5dce4..362832867aee7c03f9fd233e4aeed5cf5a8606a7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -29,7 +29,10 @@ RUN go mod download
 
 COPY . .
 
-RUN make release-binary
+# Propagate Dex version from build args to the build environment
+ARG VERSION
+RUN ([ "$VERSION" != "" ] || export $VERSION) && make release-binary
+
 RUN xx-verify /go/bin/dex && xx-verify /go/bin/docker-entrypoint
 
 FROM alpine:3.19.0 AS stager