Skip to content

Commit 6d7f3f2

Browse files
committed
Brev: Use COPY --chmod to reduce Docker image layer count.
1 parent b0e5e03 commit 6d7f3f2

File tree

5 files changed

+5
-22
lines changed

5 files changed

+5
-22
lines changed

tutorials/accelerated-python/brev/dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ RUN python -m venv ${ACH_RAPIDS_VENV} \
118118
--display-name="Python 3 (RAPIDS 25.10)" \
119119
--prefix=/usr/local
120120

121-
COPY . /accelerated-computing-hub
122-
123-
# Ensure accelerated-computing-hub directory is writable by any user
124-
RUN chmod -R a+rwX /accelerated-computing-hub
121+
COPY --chmod=0777 . /accelerated-computing-hub
125122

126123
WORKDIR /accelerated-computing-hub/tutorials/${ACH_TUTORIAL}/notebooks
127124

tutorials/cuda-cpp/brev/dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ RUN apt-get update -y \
5050
&& apt-get clean -y \
5151
&& rm -rf /var/lib/apt/lists/*
5252

53-
COPY . /accelerated-computing-hub
54-
55-
# Ensure accelerated-computing-hub directory is writable by any user
56-
RUN chmod -R a+rwX /accelerated-computing-hub
53+
COPY --chmod=0777 . /accelerated-computing-hub
5754

5855
WORKDIR /accelerated-computing-hub/tutorials/${ACH_TUTORIAL}/notebooks
5956

tutorials/cuda-tile/brev/dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ RUN curl -L -O https://developer.nvidia.com/downloads/assets/tools/secure/nsight
7777
RUN python -m jupyter labextension disable "@jupyterlab/apputils-extension:announcements" \
7878
&& python -m jupyter labextension disable "@jupyterlab/console-extension:tracker"
7979

80-
COPY . /accelerated-computing-hub
81-
82-
# Ensure accelerated-computing-hub directory is writable by any user
83-
RUN chmod -R a+rwX /accelerated-computing-hub
80+
COPY --chmod=0777 . /accelerated-computing-hub
8481

8582
WORKDIR /accelerated-computing-hub/tutorials/${ACH_TUTORIAL}/notebooks
8683

tutorials/nvmath-python/brev/dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ RUN apt-get update -y \
4747
&& apt-get clean -y \
4848
&& rm -rf /var/lib/apt/lists/*
4949

50-
COPY . /accelerated-computing-hub
51-
52-
# Ensure accelerated-computing-hub directory is writable by any user
53-
RUN chmod -R a+rwX /accelerated-computing-hub
50+
COPY --chmod=0777 . /accelerated-computing-hub
5451

5552
WORKDIR /accelerated-computing-hub/tutorials/${ACH_TUTORIAL}/notebooks
5653

tutorials/stdpar/brev/docker-recipe.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,7 @@
144144
])
145145

146146

147-
Stage0 += copy(src='.', dest='/accelerated-computing-hub')
148-
149-
# Ensure accelerated-computing-hub directory is writable by any user
150-
Stage0 += shell(commands=[
151-
'chmod -R a+rwX /accelerated-computing-hub',
152-
])
147+
Stage0 += raw(docker='COPY --chmod=0777 . /accelerated-computing-hub')
153148

154149
Stage0 += workdir(directory=f'/accelerated-computing-hub/tutorials/{tutorial}/notebooks')
155150

0 commit comments

Comments
 (0)