Skip to content

Commit 21822d8

Browse files
committed
added clean up steps after pip installs to reduce image size
1 parent 8a42219 commit 21822d8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.devops/arm64.Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ RUN apt-get update \
9696
python3 \
9797
python3-pip
9898

99-
RUN pip install --upgrade pip setuptools wheel --break-system-packages
100-
RUN pip install -r requirements.txt --break-system-packages
101-
RUN apt autoremove -y
102-
RUN apt clean -y
103-
RUN rm -rf /tmp/* /var/tmp/*
99+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel --break-system-packages
100+
RUN pip install --no-cache-dir -r requirements.txt --break-system-packages
101+
102+
# Clean up unnecessary files to reduce image size
103+
RUN rm -rf /root/.cache/pip && rm -rf /root/.cache/build && rm -rf /tmp/* && rm -rf /var/tmp/*
104+
RUN apt autoremove -y && apt clean -y
104105
RUN find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete
105106
RUN find /var/cache -type f -delete
106107

0 commit comments

Comments
 (0)