Skip to content

Commit 3788f35

Browse files
committed
Combine Dockerfile RUN statements to reduce layer count. Also unify GPU pip install into CPU image.
1 parent 4293bf3 commit 3788f35

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

docker/build.sh

100644100755
File mode changed.

docker/build_cpu.sh

100644100755
File mode changed.

docker/build_gpu.sh

100644100755
File mode changed.

docker/cpu.Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ FROM gcr.io/kaggle-images/python:latest
77
# install node and npm from nodesource https://github.com/nodesource/distributions
88
# use a local mirror of the setup script to avoid `curl | bash`
99
ADD docker/nodesource_setup_14.x.sh node_setup.sh
10-
RUN sh node_setup.sh
11-
RUN apt-get install -y nodejs
10+
RUN sh node_setup.sh && apt-get install -y nodejs
1211

1312
# link the newly installed versions to /opt/node so we can prioritize these versions over the versions /opt/conda has.
1413
RUN mkdir /opt/node && \
@@ -20,8 +19,7 @@ ENV PATH /opt/node:$PATH
2019
ENV NODE_PATH /usr/lib/node_modules
2120

2221
# confirm installation
23-
RUN node -v
24-
RUN npm -v
22+
RUN node -v && npm -v
2523

2624
# END NODE
2725

@@ -31,7 +29,6 @@ ADD ./setup.py ./setup.py
3129
ADD ./README.md ./README.md
3230
ADD ./MANIFEST.in ./MANIFEST.in
3331
ADD ./kaggle_environments ./kaggle_environments
34-
RUN pip install .
35-
RUN pytest
32+
RUN pip install Flask bitsandbytes accelerate && pip install . && pytest
3633

3734
CMD kaggle-environments

docker/gpu.Dockerfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ FROM gcr.io/kaggle-gpu-images/python:latest
77
# install node and npm from nodesource https://github.com/nodesource/distributions
88
# use a local mirror of the setup script to avoid `curl | bash`
99
ADD docker/nodesource_setup_14.x.sh node_setup.sh
10-
RUN sh node_setup.sh
11-
RUN apt-get install -y nodejs
10+
RUN sh node_setup.sh && apt-get install -y nodejs
1211

1312
# link the newly installed versions to /opt/node so we can prioritize these versions over the versions /opt/conda has.
1413
RUN mkdir /opt/node && \
@@ -20,20 +19,16 @@ ENV PATH /opt/node:$PATH
2019
ENV NODE_PATH /usr/lib/node_modules
2120

2221
# confirm installation
23-
RUN node -v
24-
RUN npm -v
22+
RUN node -v && npm -v
2523

2624
# END NODE
2725

2826
WORKDIR /usr/src/app/kaggle_environments
2927

30-
RUN pip install Flask bitsandbytes accelerate
31-
3228
ADD ./setup.py ./setup.py
3329
ADD ./README.md ./README.md
3430
ADD ./MANIFEST.in ./MANIFEST.in
3531
ADD ./kaggle_environments ./kaggle_environments
36-
RUN pip install .
37-
RUN pytest
32+
RUN pip install Flask bitsandbytes accelerate && pip install . && pytest
3833

3934
CMD kaggle-environments

0 commit comments

Comments
 (0)