MountedVolume Not Updating X11 Forwarding

Issue Type:

I am running docker an vm from which I need GUI display. I pass in X11 credentials through ssh -X. I then run a docker container mounting --volume="$HOME/.Xauthority:/root/.Xauthority:rw". I can then run a display within the container. But if I exit out of the vm and leave the container running, when I ssh back in the Xauthority file updates on the vm, but not on the container so then I get X11 authentication error within the container. This volume updates if I stop and restart the container, but that is not feasible for my application to be restarting the container constantly. If I manually update the xauth list in the container can get it running again, but why doesn’t the volume update in the container when it does on the host?

OS Version:
CentOS Linux release 7.4.1708 (Core)

App Version:
Client:
Version: 17.09.0-ce
API version: 1.32
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:41:23 2017
OS/Arch: linux/amd64

Server:
Version: 17.09.0-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:42:49 2017
OS/Arch: linux/amd64

Experimental: false

Steps to Reproduce:

Have a running container with .Xauthority volume mounted on vm. Exit vm and the ssh back in. .Xauthority updates on vm but not container, GUI apps no longer work.

I came across exactly the same problem. With some digging though I find out that it’s actually because modifications made to .Xauthority can somehow break the binding. See https://github.com/moby/moby/issues/15793 or https://stackoverflow.com/questions/53547973/files-within-docker-bind-mount-directory-not-updating. So my solution is to map the folder containing .Xauthority instead.