Skip to content

Instantly share code, notes, and snippets.

@92bondstreet
Created January 4, 2017 23:16
Show Gist options
  • Select an option

  • Save 92bondstreet/3557c6187c28746fcf6e2fcef49b5d51 to your computer and use it in GitHub Desktop.

Select an option

Save 92bondstreet/3557c6187c28746fcf6e2fcef49b5d51 to your computer and use it in GitHub Desktop.
How to start chromium inside docker container hosted by mac os
# More details
# 1. Docker for Mac and GUI applications - https://fredrikaverpil.github.io/2016/07/31/docker-for-mac-and-gui-applications/
# 2. dockerfile-fedora-chromium - https://github.com/TomasTomecek/dockerfile-fedora-chromium
❯ brew cask install xquartz
❯ open -a XQuartz
❯ ip=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
❯ xhost + $ip
❯ docker run \
--net host \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$ip:0 \
-e XAUTHORITY=/.Xauthority \
-v ~/.Xauthority:/.Xauthority:ro \
--name chromium \
tomastomecek/fedora-chromium
# With custom configuration
docker run \
--net host \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$ip:0 \
-e XAUTHORITY=/.Xauthority \
-v ~/.Xauthority:/.Xauthority:ro \
--name chromium \
tomastomecek/fedora-chromium \
/usr/bin/chromium-browser --no-sandbox --proxy-server="..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment