diff --git a/.github/workflows/docker-tag.yml b/.github/workflows/docker-tag.yml index 98fcc5c27..ad92100fc 100644 --- a/.github/workflows/docker-tag.yml +++ b/.github/workflows/docker-tag.yml @@ -36,7 +36,11 @@ jobs: - name: Run Docker buildx run: | + VERSION=${TAG#v} + PEP_VERSION=$(echo "$VERSION" | sed 's/-pre/rc/') + echo "Building with version: $PEP_VERSION" docker buildx build \ + --build-arg SETUPTOOLS_SCM_PRETEND_VERSION="$PEP_VERSION" \ --platform linux/amd64,linux/arm64 \ --tag ghcr.io/$IMAGE_NAME:$TAG \ --cache-from type=gha \ diff --git a/Dockerfile b/Dockerfile index d852e3c43..a70a23731 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ ARG DIR=/data/ FROM python:3.10-bookworm AS builder ARG VERSION +ARG SETUPTOOLS_SCM_PRETEND_VERSION="" ARG REPO RUN apt update && apt install -y git libusb-1.0-0-dev libudev-dev libffi-dev libssl-dev rustc cargo libpq-dev @@ -28,7 +29,11 @@ RUN pip3 install -r requirements.txt COPY . . -RUN pip3 install . --no-deps +RUN if [ -n "$SETUPTOOLS_SCM_PRETEND_VERSION" ]; then \ + SETUPTOOLS_SCM_PRETEND_VERSION=$SETUPTOOLS_SCM_PRETEND_VERSION pip3 install . --no-deps; \ + else \ + pip3 install . --no-deps; \ + fi FROM python:3.10-slim-bookworm as final