Skip to content

Commit

Permalink
fix: containers report wrong version (revision)
Browse files Browse the repository at this point in the history
This finally resolves the problem of a wrong version being set in
container images.

Resolves: #1354.
Overrides: #1357.
  • Loading branch information
oesteban committed Jan 13, 2025
1 parent 9d4cc9e commit 3990bc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ FROM python:slim AS src
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends git
ARG VERSION
ENV SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION

RUN python -m pip install -U pip build
COPY . /src
RUN python -m build /src
Expand Down Expand Up @@ -197,11 +200,14 @@ RUN find $HOME -type d -exec chmod go=u {} + && \
# Best practices
RUN ldconfig

# Update version
RUN export VERSION=$(python -m mriqc --version | awk '{print $NF}') \
&& echo "VERSION=$VERSION" >> /etc/environment

WORKDIR /tmp/

# Run mriqc by default
ENTRYPOINT ["/opt/conda/bin/mriqc"]
ARG VERSION
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
Expand Down

0 comments on commit 3990bc0

Please sign in to comment.