I seem to have a thing for yak shaving.
I have XQuartz 2.7.7 (xorg-server 1.15.2) running on my Mac with Yosemite. I can run xeyes locally. I have a Docker image with xeyes installed. I build it with the following Dockerfile and tag it kojiromike/xapps
:
FROM debian:jessie
RUN apt-get -qqy update \
&& apt-get -qqy install xauth x11-apps --no-install-recommends
I've tried the following attempts to get xeyes running in the container to show up on my local display:
I started boot2docker with tmp
shared so I could access .X11-unix. A tiny bit of extra work is needed because of boot2docker issue 678:
boot2docker --vbox-share=/tmp=tmp up
boot2docker ssh <<< 'sudo mount -t vboxsf tmp /tmp'
First, I just tried disabling the security mechanisms using the XQuartz interface:
I assumed I didn't need to Allow connections from network clients because I was trying to use a UNIX socket. First attempt:
$ docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY \
kojiromike/xapps xeyes
Error: Can't open display: unix:0
Next, I tried using xauth:
$ docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY \
-e XAUTH="$(xauth nextract - $DISPLAY)" kojiromike/xapps \
sh -c 'printf "%s" "$XAUTH" | xauth nmerge - && xeyes'
Error: Can't open display: unix:0
I'm running out of things to try. I've read Jessica Frazelle's Blog, but it seems like she's working directly on the Docker host, so maybe doesn't have the boot2docker issue I have.
What other steps do I need to connect to my local X server, across boot2docker, from a docker container?