Skip to content

Commit

Permalink
Adding a chromedriver to the dev container only when it's amd64. (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinswiber authored Sep 15, 2023
1 parent 04fbc2f commit 86ce53a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,22 @@ RUN cargo install wasm-opt
RUN cargo install wasm-pack
RUN cargo install just

RUN chmod -R g+w $CARGO_HOME/registry
RUN chmod -R g+w $CARGO_HOME/registry

RUN if [[ `uname -m` = "x86_64" ]]; then apt-get install -y libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 \
libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 jq; fi
RUN if [[ `uname -m` = "x86_64" ]]; then export CHROME_STABLE_DOWNLOADS=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels.Stable.downloads'); fi
RUN if [[ `uname -m` = "x86_64" ]]; then export CHROME_URL=$(echo $CHROME_STABLE_DOWNLOADS | jq -r '.chrome[] | select(.platform == "linux64").url'); fi
RUN if [[ `uname -m` = "x86_64" ]]; then export CHROMEDRIVER_URL=$(echo $CHROME_STABLE_DOWNLOADS | jq -r '.chromedriver[] | select(.platform == "linux64").url'); fi
RUN if [[ `uname -m` = "x86_64" ]]; then wget -N "$CHROME_URL" -P ~/ && \
unzip ~/chrome-linux64.zip -d ~/ && \
mv ~/chrome-linux64 /opt/chrome && \
ln -s /opt/chrome/chrome /usr/local/bin/chrome && \
chmod +x /opt/chrome && \
rm ~/chrome-linux64.zip; fi
RUN if [[ `uname -m` = "x86_64" ]]; then wget -N "$CHROMEDRIVER_URL" -P ~/ && \
unzip ~/chromedriver-linux64.zip -d ~/ && \
mv ~/chromedriver-linux64 /opt/chromedriver && \
ln -s /opt/chromedriver/chromedriver /usr/local/bin/chromedriver && \
chmod +x /opt/chromedriver && \
rm ~/chromedriver-linux64.zip; fi

0 comments on commit 86ce53a

Please sign in to comment.