diff --git a/Dockerfile b/Dockerfile index abe8f99bbf..8a655c6c13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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