Share docker images between hosts with NFS

I create the mesosphere infrastructure on AWS instances with three main servers (running zookeeper, mesos-master, marathon and haproxy) and N subordinates (running mesos-slave and docker).

If I run the same container on different slave marathons, the same image on each slave device. I would like to share one single export of nfs (say, on master1) and mount it on each slave in order to have a unique storage for images.

Im using Ubuntu on EC2 instances, so the default storage driver is a mapper device. I installed slaves to mount / var / lib / docker / devicemapper and / var / lib / docker / graph, but this ends with this error: "stale NFS file handle"

What I would like to understand:

  • Is there a way to do this using a different storage driver?
  • Anyway, the docker daemon is browsing files in this directory?
  • Is my approach wrong or can lead to cconcurrency access issues?
+6
source share
1 answer

Instead of using NFS to create a backup file system, I think it would be easier to set up the dock registry (with the volume on master1 so that the data is saved there), and on other nodes pull out images via the docker protocol, for example docker pull master1:5000/image:latest

0
source

Source: https://habr.com/ru/post/987390/


All Articles