Page 1 of 1

Bind mount volume with tos folder

Posted: 05 Mar 2020, 05:16
by Roccia7
Hello, i'm trying to bind my tos folder with docker's volume folder. I tried this https://docs.docker.com/storage/bind-mo ... t-behavior and this https://4sysops.com/archives/introducti ... d-volumes/
But don't know why i can't bind the folder. Somebody can help me please?
Thanks in advance

Re: Bind mount volume with tos folder

Posted: 19 Mar 2020, 11:11
by TMSupport
Bind TOS folder with docker's volume folder:
[root@TNAS-001DCF nginx]# docker run -itd --name nginx01 -p 8080:80 --mount type=bind,src=/mnt/nginx,dst=/usr/share/nginx/html nginx
#Using nginx image.The src parameter is the tos folder;
[root@TNAS-001DCF nginx]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f6903f0d97da nginx "nginx -g 'daemon ..." 5 seconds ago Up 3 seconds 0.0.0.0:8080->80/tcp nginx01
#nginx is start
[root@TNAS-001DCF nginx]# docker exec -it f6903f0d97da bash
#Enter the nginx container and execute the command
root@f6903f0d97da:/# touch /usr/share/nginx/html/index.html
root@f6903f0d97da:/usr/share/nginx/html# echo 'TerraMaster' >index.html
Image
root@f6903f0d97da:exit
[root@TNAS-001DCF nginx]# cat /mnt/nginx/index.html
TerraMaster
[root@TNAS-001DCF nginx]# It's OK.
Image

Re: Bind mount volume with tos folder

Posted: 19 Mar 2020, 14:51
by TMSupport
Image