Selenium: reduce image download size
This PS reduces the net size of the download for the selenium images by reducing their builds to a smaller number of layers. Change-Id: I830de4f4381ac91ff939da75bf01528c3844753b Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:

committed by
Andrii Ostapenko

parent
5046975869
commit
dde30d005c
@@ -3,19 +3,19 @@ FROM ${FROM}
|
||||
LABEL maintainer="cloud-devel@suse.com"
|
||||
|
||||
COPY linux_signing_key.pub /tmp/
|
||||
RUN rpm --import /tmp/linux_signing_key.pub
|
||||
RUN rm /tmp/linux_signing_key.pub
|
||||
|
||||
RUN zypper --non-interactive addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 google_chrome
|
||||
|
||||
RUN set -ex ;\
|
||||
rpm --import /tmp/linux_signing_key.pub ;\
|
||||
rm /tmp/linux_signing_key.pub ;\
|
||||
zypper --non-interactive addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 google_chrome ;\
|
||||
zypper --non-interactive refresh ;\
|
||||
zypper --non-interactive up -y ;\
|
||||
zypper --non-interactive install -y python-pip unzip wget google-chrome-stable
|
||||
|
||||
RUN /usr/bin/pip install selenium
|
||||
|
||||
RUN wget --directory-prefix=/tmp/ https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip \
|
||||
&& unzip /tmp/chromedriver_linux64.zip -d /etc/selenium
|
||||
|
||||
RUN zypper clean -a
|
||||
zypper --non-interactive install -y \
|
||||
python-pip \
|
||||
unzip \
|
||||
wget \
|
||||
google-chrome-stable ;\
|
||||
/usr/bin/pip install \
|
||||
selenium ;\
|
||||
wget --directory-prefix=/tmp/ https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip ;\
|
||||
unzip /tmp/chromedriver_linux64.zip -d /etc/selenium ;\
|
||||
zypper clean -a
|
||||
|
@@ -1,17 +1,16 @@
|
||||
ARG FROM=docker.io/ubuntu:bionic
|
||||
FROM ${FROM}
|
||||
|
||||
RUN apt-get -y update \
|
||||
&& apt-get install --no-install-recommends -y python3 python3-pip unzip wget gnupg \
|
||||
&& python3 -m pip install --upgrade pip \
|
||||
&& python3 -m pip install selenium
|
||||
|
||||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
||||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
|
||||
&& wget --directory-prefix=/tmp/ https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip \
|
||||
&& unzip /tmp/chromedriver_linux64.zip -d /etc/selenium
|
||||
|
||||
RUN apt-get -y update \
|
||||
&& apt-get install --no-install-recommends -y google-chrome-stable \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN set -xe; \
|
||||
apt-get -y update; \
|
||||
apt-get install --no-install-recommends -y python3 python3-pip unzip wget gnupg; \
|
||||
python3 -m pip install --upgrade pip; \
|
||||
python3 -m pip install selenium; \
|
||||
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -; \
|
||||
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'; \
|
||||
wget --directory-prefix=/tmp/ https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip; \
|
||||
unzip /tmp/chromedriver_linux64.zip -d /etc/selenium; \
|
||||
apt-get -y update; \
|
||||
apt-get install --no-install-recommends -y google-chrome-stable; \
|
||||
apt-get clean; \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/*
|
||||
|
Reference in New Issue
Block a user