Skip to content

Commit 839747c

Browse files
authored
BLD: Decrease size of docker image (#61430)
* Decrease size of docker image Combining RUN commands to minimise the number of layers and cleaning up the apt lists to reduce total size. * Combine upgrade and install steps Combine upgrade and install steps Add --no-install-recommends option
1 parent 9bfbe9e commit 839747c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
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 --no-install-recommends -y upgrade && \
6+
apt-get --no-install-recommends -y install \
7+
build-essential \
8+
bash-completion \
9+
# hdf5 needed for pytables installation
10+
libhdf5-dev \
11+
# libgles2-mesa needed for pytest-qt
12+
libgles2-mesa-dev && \
13+
rm -rf /var/lib/apt/lists/*
614

7-
# hdf5 needed for pytables installation
8-
# libgles2-mesa needed for pytest-qt
9-
RUN apt-get install -y libhdf5-dev libgles2-mesa-dev
10-
11-
RUN python -m pip install --upgrade pip
1215
COPY requirements-dev.txt /tmp
13-
RUN python -m pip install -r /tmp/requirements-dev.txt
16+
RUN python -m pip install --no-cache-dir --upgrade pip && \
17+
python -m pip install --no-cache-dir -r /tmp/requirements-dev.txt
1418
RUN git config --global --add safe.directory /home/pandas
1519

1620
ENV SHELL="/bin/bash"

0 commit comments

Comments
 (0)