3

I have installed CoreOS which by default using loop-back device with size of 100GB and I have reached that limit very easily.

My first idea was to place all the images on top of my NAS using NFS with simply mounting it on top of the /var/lib/docker directory without any success.

Now I have found this article and its looks like docker creates block device in any way, on top of any kind of storage in order to use it's CoW snapshots and that's probably why I wasn't successful on my first shot with simply mounting NFS share on top of image directory. It kind of freaks me out. Why not use pure NFS with native snapshots of the storage? I hope there is good explanation of doing this. In any way I need to do this freak thing. I'm new to docker and CoreOS and do not know how to do this properly. So the question is: How to mount an NFS share and use it for all the images on CoreOS?

  • any success in this quest? I'm trying to do the same as I've got a NAS server and would like too save and manage the storage from there – Ponte Nov 16 '16 at 10:43
1

Good news, you're not the first person with a need to do this. Docker cannot use direct NFS because it needs both support for extended attributes (xttrs) to be able to store options like kernel capabilities, SELinux context, etc. By faking things out by using device mapper to create a virtualized block device on remote storage you are providing the required kernel mechanisms to utilize Docker via a secondary mechanism. While this can be configured via the dm.loopdatasize option, as they explicitly point out on the Docker page "Note: This option configures devicemapper loopback, which should not be used in production.".

In the end this comes down to the requirements on the underlying storage. Docker is merely using mechanisms provided by the kernel and not doing magic on it's own.

  • Hi Brian. Thanks for the reply! So at the bottom line, what production-ready options do we have for storage? I suppose it is only block-storage like FCoE/FC/iSCSI/Dirrect attached Storage? And no NAS available for image sharing between CoreOS cluster nodes? – BBK Mar 17 '16 at 7:14
  • 1
    I know of folks doing all of those options (just remember to run the userspace tools from a container). Keep in mind that the containers themselves should be ephemeral while the data generated by them should be stored to a durable location. Keeping that in mind, you can easily run your containers using overlayfs and then mount in NFS to the host and bind mount a data path into the container. I've done this with Gluster with success in the past. – Brian Redbeard Mar 18 '16 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.