File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -202,4 +202,21 @@ RUN useradd -d /h -u ${UID} ${USERNAME}
202202# Allow nopasswd sudo
203203RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
204204
205+ # Install Chrome.
206+ RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub -o /tmp/google.pub \
207+ && cat /tmp/google.pub | apt-key add -; rm /tmp/google.pub \
208+ && echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google.list \
209+ && mkdir -p /usr/share/desktop-directories \
210+ && apt-get -y update && apt-get install -y google-chrome-stable
211+
212+ # Disable the SUID sandbox so that Chrome can launch without being in a privileged container.
213+ RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /opt/google/chrome/google-chrome \
214+ && echo "#!/bin/bash\n exec /opt/google/chrome/google-chrome.real --no-sandbox --disable-setuid-sandbox \"\$ @\" " > /opt/google/chrome/google-chrome \
215+ && chmod 755 /opt/google/chrome/google-chrome
216+
217+ # Install Chrome Driver.
218+ RUN mkdir -p /opt/selenium \
219+ && curl http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip -o /opt/selenium/chromedriver_linux64.zip \
220+ && cd /opt/selenium; unzip /opt/selenium/chromedriver_linux64.zip; rm -rf chromedriver_linux64.zip; ln -fs /opt/selenium/chromedriver /usr/local/bin/chromedriver;
221+
205222CMD ["python3" ]
You can’t perform that action at this time.
0 commit comments