added chromedriver

This commit is contained in:
marvzhang
2020-07-30 12:02:11 +08:00
parent b08fcc77da
commit 375d7a96da
6 changed files with 157 additions and 11 deletions

View File

@@ -0,0 +1,18 @@
export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install \
unzip \
&& \
DL=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& curl -sL "$DL" > /tmp/chrome.deb \
&& apt install --no-install-recommends --no-install-suggests -y \
/tmp/chrome.deb \
&& CHROMIUM_FLAGS='--no-sandbox --disable-dev-shm-usage' \
# Patch Chrome launch script and append CHROMIUM_FLAGS to the last line:
&& sed -i '${s/$/'" $CHROMIUM_FLAGS"'/}' /opt/google/chrome/google-chrome \
&& BASE_URL=https://chromedriver.storage.googleapis.com \
&& VERSION=$(curl -sL "$BASE_URL/LATEST_RELEASE") \
&& curl -sL "$BASE_URL/$VERSION/chromedriver_linux64.zip" -o /tmp/driver.zip \
&& unzip /tmp/driver.zip \
&& chmod 755 chromedriver \
&& mv chromedriver /usr/local/bin