You can configure DTR to store Docker images in an NFS directory.
Before installing or configuring DTR to use an NFS directory, make sure that:
To confirm that the hosts can connect to the NFS server, try to list the directories exported by your NFS server:
showmount -e <nfsserver>
You should also try yo mount one of the exported directories:
mkdir /tmp/mydir && sudo mount -t nfs <nfs server>:<directory>
One way to configure DTR to use an NFS directory is at install time:
docker run -it --rm docker/dtr install \
--nfs-storage-url <nfs-storage-url> \
<other options>
The NFS storage URL should be in the format nfs://<nfs server>/<directory>
.
When you join replicas to the DTR cluster, the replicas will pick up that configuration, so you don’t need to specify it again.
If you’re upgrading from a previous version of DTR and are already using NFS you can continue using the same configurations.
If you want to start using the new DTR built-in support for NFS you can reconfigure DTR:
docker run -it --rm docker/dtr reconfigure \
--nfs-storage-url <nfs-storage-url>
If you want to reconfigure DTR to stop using NFS storage, leave the option in blank:
docker run -it --rm docker/dtr reconfigure \
--nfs-storage-url ""
If the IP address of your NFS server changes, even if the DNS address is kept the same, you should reconfigure DTR to stop using NFS storage, and then add it back again.