I have read the guidelines to run GUI apps inside docker. But when it comes to Mac, all the guides rely on boot2docker or running docker inside a VM and forwarding the x11 using xquartz.
Since we have docker for mac now, is it possible to forward the video and audio directly without using xquartz or vnc?
From Jessie’s blog, in docker run command these are the parameters I am interested in.
docker run -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket
-e DISPLAY=unix$DISPLAY \ # pass the display
--device /dev/snd \ # sound
--name spotify \
jess/spotify
I am actually looking to pass the display and sound. Is it possible without using vnc or xquartz?
As far us I have explored, OS X doesn’t expose device files like /dev/snd or /dev/video. Also, there is no x11 client to expose it by default. So relying on xquartz or something like that is needed. I will explore further and update the thread
Start XQuartz (open -a Quartz) before running your container, you may have to enable the option Security/Allow connections from network client. After that you can run your container and make sure that you have /tmp/.X11-unix mounted.
I am able to get Webstorm run in native Docker container this way.
I followed that guide, and it worked after I actually read that you need to either edit the startx script or use a beta version of Xquartz 2.7.10.
Anyway, I was wondering if it is possible in principle to make use of retina displays properly with Docker for Mac? Apparently under Xquartz this is an insurmountable barrier. Nonetheless, using Virtualbox it seems to be possible. Is this something that Docker for Mac could allow as well?
Just replying to say I have no idea. I had a hard time finding a concrete step-by-step guide on just getting started and figured I’d share my findings.
I stumbled on your StackOverflow question when googled on the same. My machine does’t have xhost command. Also, do I need to run the xhost + command on the shell that is running xQuartz?
@fredrikaverpil, after reading about xhost a little bit, it is unsafe to do xhost + $ip, as we will be using private ip addresses most of the time. It is better to add using hostname,
xhost + $(hostname)
or we have to remove the ip if we switch to another network or ip address gets renewed(to a new address) xhost - $ip
Hi, I’m trying to run your chrome container following your command in the xrdp readme:
docker run --name docker -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker:/usr/local/bin/docker busybox true
Is the -v flag correct in this command? I get an error “mkdir /usr/local/bin/docker: file exists”
I’m very new to docker, so I’m sorry if I’m missing something trivial here.
These were pretty interesting. Though maybe not totally what I’m looking for.
I’d like somehow to provide a painfully simple installable app (think drag and drop) for end users. Basically it would be great if they could click on the app and behind the scenes it starts up a Docker container and opens a browser to an exposed port on the container. I expect this gets massive if I try to use things like VirtualBox. Preferably I’d like to use the Hypervisor.framework on Mac to provide this functionality to keep things lean. Are there any recommendations or suggestions for how one might go about bundling Docker up for this use case? Any other projects that might be relevant?
All solutions for X forwarding base on a running X server, you will need XQuartz in every case. It is possible to use xpra and Xephyr to show single applications or desktop environments. Both are available for Mac.
Usage of xhost should be avoided due to possible security leaks. x11docker creates X server cookies for authentication with xauth and shares them with containers, this should be possible with XQuartz in the same way.
Maybe x11docker script can be adapted for Mac with slight adjustments.