NFS Shares
Nautical itself does not have the ability to map network shares. However, it can use a network share for either the source or destination.
Commonly, we run containers on our host machine, then use an NFS share as the backup destination location. This page will give a brief overview of how to do that.
Connect to an NFS Share On Container Host (Linux)¶
-
Create the NFS destination directories.
# Create mount point (1) mkdir -p /mnt/nfs/docker_backups
- The destination directories must exist before a mount can be created
-
Setup NFS mount points:
This will open a file, and here you can insert your NFS configuration:nano /etc/fstab
/etc/fstabTip:# | ------------- Source -------------- | ---- Destination ---- | -------- Options ---------- | 192.168.1.10:/mnt/backups/docker_volumes /mnt/nfs/docker_backups nfs _netdev,auto,rw,async 0 0
192.168.1.10
is just an example IP address -
Apply and mount the NFS shares
mount -a
A successful
mount -a
will return nothing in the console -
Verify read and write access
cd /mnt/nfs/docker_backups touch test.txt && rm test.txt
Add Nautical Backup¶
The above example created a local directory of /mnt/nfs/docker_backups
which is an NFS share pointing to 192.168.1.10:/mnt/backups/docker_volumes
.
Here is how we can use this new mount withing Nautical:
services:
nautical-backup:
image: minituff/nautical-backup:2.9 #(7)!
container_name: nautical-backup
volumes:
- /var/run/docker.sock:/var/run/docker.sock #(1)!
- /config:/config #(9)!
- /source:/app/source #(2)!
- /mnt/nfs/docker_backups:/app/destination #(3) <-- NFS Share
- Mount the docker socket. Used to start and stop containers. See the Docker Socket Proxy page for more information.
- Mount the
source
directory. - Mount the
destination
directory. - TIP: Avoid using "quotes" in the enviornment variables.
- Scheduled time to run backups. Use this website to help pick a CRON schedule.
- Default =
0 4 * * *
- Every day at 4am.
- Default =
- Containers to skip for backup. A comma seperated list.
- It is recommended to avoid using the
latest
tag.- This project is under active development, using a exact tag can help avoid updates breaking things.
- Set the time-zone. See this Wikipedia page for a list of available time-zones.
- Configuration folder. This directory will will Nautical's internal database which stores metrics and history.
docker run -d \
--name nautical-backup \
-v /var/run/docker.sock:/var/run/docker.sock \ #(1)!
-v /config:/config \ #(9)!
-v /mnt/nfs/docker_backups:/app/destination \ #(2)!
-e SKIP_CONTAINERS="example1,example2,example3" \ #(6)!
minituff/nautical-backup:2.9 #(7)!
- Mount the docker socket. Used to start and stop containers. See the Docker Socket Proxy page for more information.
- Mount the
source
directory. - Mount the
destination
directory. - TIP: Avoid using "quotes" in the enviornment variables.
- Scheduled time to run backups. Use this website to help pick a CRON schedule.
- Default =
0 4 * * *
- Every day at 4am.
- Default =
- Containers to skip for backup. A comma seperated list.
- It is recommended to avoid using the
latest
tag.- This project is under active development, using a exact tag can help avoid updates breaking things.
- Set the time-zone. See this Wikipedia page for a list of available time-zones.
- Configuration folder. This directory will will Nautical's internal database which stores metrics and history.