Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:20.10-py3
FROM ${PYTORCH_IMAGE} as base

WORKDIR /opt/monai
COPY . .

ENV PATH=/opt/tools:$PATH

# ignore "torch" in requirements.txt, as we prefer PYTORCH_IMAGE
RUN cp requirements.txt req.bak \
&& awk '!/torch/' requirements.txt > tmp && mv tmp requirements.txt \
&& python -m pip install --no-cache-dir -U pip wheel \
&& python -m pip install --no-cache-dir -r requirements-dev.txt \
&& mv req.bak requirements.txt \
&& BUILD_MONAI=1 FORCE_CUDA=1 python setup.py develop
# restored the original requirements.txt so that the version string is clean
# install full deps
COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/
RUN cp /tmp/requirements.txt /tmp/req.bak \
&& awk '!/torch/' /tmp/requirements.txt > /tmp/tmp && mv /tmp/tmp /tmp/requirements.txt \
&& python -m pip install --no-cache-dir --use-feature=2020-resolver -r /tmp/requirements-dev.txt

# compile ext and remove temp files
COPY . .
RUN BUILD_MONAI=1 FORCE_CUDA=1 python setup.py develop \
&& rm -rf builds __pycache__

# NGC Client
WORKDIR /opt/tools
Expand Down