diff --git a/.dockerignore b/.dockerignore index b8823013..4bd87a7d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -19,7 +19,6 @@ data config.*.yaml config.yaml -.git warpgate-web/dist warpgate-web/node_modules warpgate-web/src/admin/lib/api-client/ diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7dde70d1..81451257 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -37,6 +37,7 @@ jobs: uses: actions/checkout@v2 with: submodules: recursive + fetch-depth: 0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -64,6 +65,7 @@ jobs: uses: docker/build-push-action@v6.13.0 with: file: docker/Dockerfile + context: . push: false labels: ${{ steps.meta.outputs.labels }} platforms: ${{ matrix.docker-platform }} @@ -75,6 +77,7 @@ jobs: uses: docker/build-push-action@v6.13.0 with: file: docker/Dockerfile + context: . push: true labels: ${{ steps.meta.outputs.labels }} platforms: ${{ matrix.docker-platform }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 757c9502..db44329f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1.3-labs -FROM rust:1.79.0-bullseye AS build +FROM rust:1.85.0-bullseye AS build -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get update \ @@ -11,17 +11,21 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ COPY . /opt/warpgate -ENV SOURCE_DATE_EPOCH 0 # for rust-embed determinism +# Needed to correctly embed the version number and the dirty state flag +COPY .git/ /opt/warpgate/.git/ + +# for rust-embed determinism +ENV SOURCE_DATE_EPOCH=0 RUN cd /opt/warpgate \ && just npm ci \ && just openapi \ && just npm run build \ && cargo build --features mysql,postgres --release -FROM debian:bullseye-20221024 +FROM debian:bullseye-20250520 LABEL maintainer=heywoodlh -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN <, }, + /// Show version information + Version, } async fn _main() -> Result<()> { @@ -104,6 +106,10 @@ async fn _main() -> Result<()> { .unwrap(); match &cli.command { + Commands::Version => { + println!("warpgate {}", warpgate_version()); + return Ok(()); + } Commands::Run { enable_admin_token } => { crate::commands::run::command(&cli, *enable_admin_token).await }