Skip to content

Commit a4ef691

Browse files
authored
Improve docker build process (#1419)
* Improve docker build process, fixes #1276
1 parent 53c145d commit a4ef691

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Ignore the following files/folders during docker build
2+
3+
__pycache__/
4+
docs/
5+
6+
.coverage
7+
.readthedocs.yml
8+
*.md
9+
*.toml
10+
11+
!README.md
12+

.github/workflows/cron.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
runs-on: [self-hosted, linux, x64, common]
6262
steps:
6363
- name: Run tests report coverage
64+
# The docker image process has done the compilation. BUILD_MONAI=1 may not be necessary.
6465
run: |
6566
cd /opt/monai
6667
nvidia-smi

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ FROM ${PYTORCH_IMAGE}
1616
MAINTAINER MONAI Consortium <[email protected]>
1717

1818
WORKDIR /opt/monai
19-
ENV PATH=/opt/tools:${PATH}
2019

2120
# install full deps
2221
COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/
@@ -28,7 +27,11 @@ RUN cp /tmp/requirements.txt /tmp/req.bak \
2827
# TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276)
2928
# please specify exact files and folders to be copied -- else, basically always, the Docker build process cannot cache
3029
# this or anything below it and always will build from at most here; one file change leads to no caching from here on...
31-
COPY . .
30+
31+
COPY LICENSE setup.py setup.cfg versioneer.py runtests.sh .gitignore .gitattributes README.md MANIFEST.in ./
32+
COPY tests ./tests
33+
COPY monai ./monai
34+
COPY .git ./.git
3235
RUN BUILD_MONAI=1 FORCE_CUDA=1 python setup.py develop \
3336
&& rm -rf build __pycache__
3437

0 commit comments

Comments
 (0)