Skip to content

Commit 76692c1

Browse files
committed
Cleanup image layer after apt-get update and install
1 parent cc243ee commit 76692c1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

helm-chart/images/binderhub/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ ARG DIST
1313
# Install node as required to package binderhub to a wheel
1414
RUN echo "deb http://deb.nodesource.com/node_14.x $DIST main" > /etc/apt/sources.list.d/nodesource.list \
1515
&& curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
16-
RUN apt-get update && \
17-
apt-get install --yes \
18-
nodejs
16+
RUN apt-get update \
17+
&& apt-get install --yes \
18+
nodejs \
19+
&& rm -rf /var/lib/apt/lists/*
1920

2021
# Copy the whole git repository to /tmp/binderhub
2122
COPY . /tmp/binderhub
@@ -33,9 +34,11 @@ FROM python:3.8-slim-$DIST
3334
WORKDIR /
3435

3536
# The slim version doesn't include git as required by binderhub
36-
RUN apt-get update && \
37-
apt-get install --yes \
38-
git
37+
RUN apt-get update \
38+
&& apt-get install --yes \
39+
git \
40+
&& rm -rf /var/lib/apt/lists/*
41+
3942

4043
# Copy the built wheels from the build-stage. Also copy the image
4144
# requirements.txt built from the binderhub package requirements.txt and the

0 commit comments

Comments
 (0)