Skip to content

Commit a1809ef

Browse files
committed
Optimize package installation in docker base image
- Add --no-install-recommends option in order to install only what is required - Remove Node.js as it is not used by this project - Do not install sudo as it's not required - Limit the number of RUN - Delete apt cache: rm -rf /var/lib/apt/lists/* - Update google-chrome-stable (the old version isn't available anymore)
1 parent 5e0e923 commit a1809ef

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

scraper/dev/docker/Dockerfile.base

+18-22
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,29 @@ RUN chgrp -R seleuser /home/seleuser
1212

1313
WORKDIR /home/seleuser
1414

15-
RUN apt-get update -y && apt-get install -yq \
16-
software-properties-common\
17-
python3.10
18-
RUN add-apt-repository -y ppa:openjdk-r/ppa
19-
RUN apt-get update -y && apt-get install -yq \
20-
curl \
21-
wget \
22-
sudo \
23-
gnupg \
24-
&& curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
25-
RUN apt-get update -y && apt-get install -y \
26-
nodejs
27-
RUN apt-get update -y && apt-get install -yq \
28-
unzip \
29-
xvfb \
30-
libxi6 \
31-
libgconf-2-4 \
32-
default-jdk
15+
RUN apt-get update -y && \
16+
apt-get install -yq --no-install-recommends \
17+
gnupg \
18+
software-properties-common \
19+
python3.10 \
20+
python3-pip && \
21+
add-apt-repository -y ppa:openjdk-r/ppa && \
22+
apt-get install -yq --no-install-recommends \
23+
curl \
24+
wget \
25+
xvfb \
26+
libxi6 \
27+
libgconf-2-4 \
28+
default-jdk && \
29+
rm -rf /var/lib/apt/lists/*
3330

3431
# https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable for references around the latest versions
3532
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
3633
RUN echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
3734
RUN apt-get update -y && apt-get install -yq \
38-
google-chrome-stable=113.0.5672.126-1 \
39-
unzip
35+
google-chrome-stable=121.0.6167.85-1 \
36+
unzip && \
37+
rm -rf /var/lib/apt/lists/*
4038
RUN wget -q https://chromedriver.storage.googleapis.com/113.0.5672.63/chromedriver_linux64.zip
4139
RUN unzip chromedriver_linux64.zip
4240
RUN rm -f chromedriver_linux64.zip
@@ -55,8 +53,6 @@ COPY Pipfile.lock .
5553
ENV LC_ALL C.UTF-8
5654
ENV LANG C.UTF-8
5755
ENV PIPENV_HIDE_EMOJIS 1
58-
RUN apt-get update -y && apt-get install -yq \
59-
python3-pip
6056
RUN pip3 install pipenv
6157

6258
USER 1000

0 commit comments

Comments
 (0)