Skip to content

Commit 3990bc0

Browse files
committed
fix: containers report wrong version (revision)
This finally resolves the problem of a wrong version being set in container images. Resolves: #1354. Overrides: #1357.
1 parent 9d4cc9e commit 3990bc0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Dockerfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ FROM python:slim AS src
3232
RUN apt-get update && \
3333
DEBIAN_FRONTEND=noninteractive \
3434
apt-get install -y --no-install-recommends git
35+
ARG VERSION
36+
ENV SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION
37+
3538
RUN python -m pip install -U pip build
3639
COPY . /src
3740
RUN python -m build /src
@@ -197,11 +200,14 @@ RUN find $HOME -type d -exec chmod go=u {} + && \
197200
# Best practices
198201
RUN ldconfig
199202

203+
# Update version
204+
RUN export VERSION=$(python -m mriqc --version | awk '{print $NF}') \
205+
&& echo "VERSION=$VERSION" >> /etc/environment
206+
200207
WORKDIR /tmp/
201208

202209
# Run mriqc by default
203210
ENTRYPOINT ["/opt/conda/bin/mriqc"]
204-
ARG VERSION
205211
ARG BUILD_DATE
206212
ARG VCS_REF
207213
LABEL org.label-schema.build-date=$BUILD_DATE \

0 commit comments

Comments
 (0)