Created
July 29, 2021 20:14
-
-
Save dqminh/b886b0f764a2f8863ad69d677993dca0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run Chrome in a container | |
runtime=$1 | |
ARGS="--net host" | |
if [ -z $runtime ]; then | |
ARGS="${ARGS}" | |
else | |
echo "running with $runtime" | |
shift | |
ARGS="${ARGS} --runtime $runtime" | |
fi | |
if [ ! -f "$HOME/chrome.json" ]; then | |
wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json | |
fi | |
xhost +local:chrome | |
docker run -it --rm \ | |
$ARGS \ | |
--memory 2048mb \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |
-v $HOME/Downloads:/home/chrome/Downloads \ | |
-e DISPLAY=unix$DISPLAY \ | |
--security-opt seccomp=$HOME/chrome.json \ | |
--device /dev/snd \ | |
--device /dev/dri \ | |
--name chrome \ | |
--hostname chrome \ | |
jess/chrome "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment