for-azure
for-azure copied to clipboard
Document how to do host mounts and/or backups/restores
The fact that managers and workers are running in containers creates unexpected behavior when doing things like host mounts.
For example, on a worker node:
$ cd ~docker
$ touch foobar
$ docker run -it --rm -v /home/docker/:/foo ubuntu /bin/bash`
# ls -a /foo
.ssh
Presumably this is because the mount is on the host, and not from the container that executes the docker command, so the ubuntu container is seeing the vm's /home/docker and not the workers /home/docker.
I noticed the latest version of the documentation does not even mention that the manager and workers are running inside containers themselves, so the above behavior would be very surprising to someone who does not know this.
The reason I was doing the host mount was to restore some volume data from a backup in a tar.gz. Because I was unable to do the host mount, I ended up piping the tar.gz into the restore container via standard input. Perhaps this technique, or other recommended approach for this use case, could be documented/mentioned also?
I couldn't work out why I couldn't mount volumes and was about to file a bug for it. You've just explained it thankyou! This really should be in the documentation - it's a pretty basic thing that is broken.
@rocketraman Have you found a way to mount a host directory inside the containers yet?
I was able to mount a directory in /tmp after some tries, but not from anywhere else...
@vovimayhem Nope, honestly, I gave up on Docker Swarm on Azure and moved to Kubernetes. I have to say, Kubernetes is a bit more complicated, but well worth the effort. Docker Swarm on Azure has promise for simpler requirements, but in my opinion, there is a bit too much "magic", and that combined with its pretty raw state led to too many frustrations. I wasn't comfortable with my ability to support it in a production environment. Hopefully it'll get there in the future.