
上QQ阅读APP看书,第一时间看更新
Bind mounting a host volume to keep data
When using the single node installation?, the persistent data is kept on the /var/lib/rancher path in the container.
To keep data on the host, you can bind mount a host volume to a location using the following command:
$ docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
-v /opt/rancher:/var/lib/rancher \
-v /var/log/rancher/auditlog:/var/log/auditlog \
rancher/rancher:latest
Bind mounts have limited functionality compared to volumes. When Rancher is started using the bind mount, a directory on the host machine will be mounted to the specified directory in the container.