Skip to content

Instantly share code, notes, and snippets.

@grantseltzer
Created November 14, 2017 02:24
Show Gist options
  • Save grantseltzer/a57cf4247beb1397b321ba01556661db to your computer and use it in GitHub Desktop.
Save grantseltzer/a57cf4247beb1397b321ba01556661db to your computer and use it in GitHub Desktop.
Container functions
function chrome() {
docker run \
--rm \
--security-opt seccomp=$HOME/.seccomp/chrome.json \
--net=host \
--memory 512mb \
--cpuset-cpus 0 \
-e DISPLAY=unix$DISPLAY \
-v $HOME/Downloads:$HOME/Downloads \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--group-add video \
--group-add audio \
--device /dev/dri \
--device /dev/snd \
--ipc='host' \
--name chrome \
-v $HOME/.chrome:/data \
grantseltzer/chrome:v0 \
/usr/bin/google-chrome --user-data-dir=/data
}
function code() {
docker run \
--rm \
-it \
-e DISPLAY=unix$DISPLAY \
-e GOPATH=/home/go \
-v $HOME/go:$HOME/go \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.ssh:$HOME/.ssh \
--group-add video \
--group-add audio \
--device /dev/dri \
--device /dev/snd \
--name code \
grantseltzer/vscode:v0 \
zsh
}
function slack() {
docker run \
--rm \
--net=host \
-e DISPLAY=unix$DISPLAY \
-v $HOME/Downloads:$HOME/Downloads \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--group-add video \
--group-add audio \
--device /dev/dri \
--device /dev/snd \
--ipc='host' \
--name slack \
grantseltzer/slack:v0 \
/usr/bin/slack
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment