OSX + Docker + GUI

Prereqs:

  • OS X 10.11.6 (El Capitan)
  • Docker
  • XQuartz
  • Jessie Frazelle’s Dockerfile

Install

brew cask install xquartz
## restart ## 
open -a XQuartz
ip=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
## command + , : Preferences -> Security 
# Check both boxes :)
xhost + $ip

Firefox

docker run -it \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}'):0 \
    --name firefox \
    jess/firefox

Chrome

docker run -it \
    --memory 512mb \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}'):0 \
    -v $HOME/Downloads:/root/Downloads \
    -v $HOME/.config/google-chrome/:/data \
    --name chrome \
    --cap-add=SYS_ADMIN \
    jess/chrome

For a more detailed write up see: Docker for Mac and GUI applications

Sources:

results matching ""

    No results matching ""