[why] our os-cifs container will mount three dir, /srv/os /srv/initrd /srv/result it's may cause: 1. our cifs service becomes slow 2. if the container exit, none of the three folders can be accessed. in order to reduce the coupling, need split them
[how] one folder mount by one container
usage: if you want mount these floder, you can use these command server: /srv/os client: mount -t cifs -o guest //ip/os /tmp/os
server: /srv/initrd client: mount -t cifs -o guest,port=446 //ip/initrd /tmp/initrd
server: /srv/result client: mount -t cifs -o guest,port=447 //ip/result /tmp/result --- container/os-cifs/start | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/container/os-cifs/start b/container/os-cifs/start index 6cc08c6..e20f887 100755 --- a/container/os-cifs/start +++ b/container/os-cifs/start @@ -8,18 +8,40 @@ lsmod | grep -q "^cifs\s" || { sudo modprobe cifs }
-docker_rm samba +docker_rm os-cifs +docker_rm initrd-cifs +docker_rm result-cifs
-cmd=( +os_cifs_cmd=( docker run -dt -p 445:445 + -v /etc/localtime:/etc/localtime:ro -v /srv/os:/srv/os + --name os-cifs + --restart=always + alpine/samba +) + +initrd_cifs_cmd=( + docker run -dt + -p 446:445 -v /etc/localtime:/etc/localtime:ro -v /srv/initrd:/srv/initrd + --name initrd-cifs + --restart=always + alpine/samba +) + +result_cifs_cmd=( + docker run -dt + -p 447:445 + -v /etc/localtime:/etc/localtime:ro -v /srv/result:/srv/result - --name os-cifs + -name result-cifs --restart=always alpine/samba )
-"${cmd[@]}" +"${os_cifs_cmd[@]}" +"${initrd_cifs_cmd[@]}" +"${result_cifs_cmd[@]}"