Skip to content

Commit cfc299d

Browse files
authored
Decrease size of docker image
Combining RUN commands to minimise the number of layers and cleaning up the apt lists to reduce total size.
1 parent 3832e85 commit cfc299d

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
FROM python:3.10.8
22
WORKDIR /home/pandas
33

4-
RUN apt-get update && apt-get -y upgrade
5-
RUN apt-get install -y build-essential bash-completion
4+
RUN apt-get update && \
5+
apt-get -y upgrade && \
6+
rm -rf /var/lib/apt/lists/*
67

7-
# hdf5 needed for pytables installation
8-
# libgles2-mesa needed for pytest-qt
9-
RUN apt-get install -y libhdf5-dev libgles2-mesa-dev
8+
RUN apt-get update && apt-get install -y \
9+
build-essential \
10+
bash-completion \
11+
# hdf5 needed for pytables installation
12+
libhdf5-dev \
13+
# libgles2-mesa needed for pytest-qt
14+
libgles2-mesa-dev && \
15+
rm -rf /var/lib/apt/lists/*
1016

11-
RUN python -m pip install --upgrade pip
1217
COPY requirements-dev.txt /tmp
13-
RUN python -m pip install -r /tmp/requirements-dev.txt
18+
RUN python -m pip install --no-cache-dir --upgrade pip && \
19+
python -m pip install --no-cache-dir -r /tmp/requirements-dev.txt
1420
RUN git config --global --add safe.directory /home/pandas
1521

1622
ENV SHELL="/bin/bash"

0 commit comments

Comments
 (0)