Question

I love the idea of separating my data into a data-container and keeping my application in an "application container" for various reasons. However, it seems that to share data between containers, you need to use volumes which are not kept within the UFS, and hence will not be stored in any commits you perform on the data container. This is advertised as an advantage due to lower overheads, but has the major drawback of not being able to take snapshots through the use of commit.

Is there a way to force a volume to be held within the UFS? Or perhaps there is a workaround that shares data from within containers without the use of volumes. Both situations would mean I can take snapshots of the data (this also means that snapshots are incremental which is an added bonus). For now, all I can think of is trying to mount data within the data container through an NFS export.

Était-ce utile?

La solution

There is currently no way to snapshot a volume, because by essence, volumes are kept out of the copy-on-write storage. However, this might change in the future, since it's becoming a frequent request.

If you really need that feature in the short term, you could bind-mount a host volume which would itself be snapshot-able. E.g., you could mount a BTRFS filesystem on /btrfs on the host, then have a /btrfs/data subvolume, and then do something like docker run -v /btrfs/data:/var/data … to bind-mount that subvolume in the container.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top