On my OSX, I can show a gui interface from a docker container successfully with Xqautz as the following command:
docker run -v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY --privileged -ti MY_OWN_DOCKER_IMAGE bash
However, I would like to put MY_OWN_DOCKER_IMAGE inside a docker-machine(called default) and show the gui interface on my OSX.
My scenario like below:
I got a question here: how do I set the "-v" and "-e" parameters when I am trying to do "docker run MY_OWN_DOCKER_IMAGE" inside default VM? or is there any other solution?
I found solution here: X11 forwarding doesn't work when image runs in docker machine but it works fine if the image is run w/oa docker machine
-v should be like : -v /var/run/docker.sock:/var/run/docker.sock
but -e DISPLAY should be given an ip(check it from XQuartz with command "xhost")
Now I can show gui interface from container running in a docker machine VM!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.