On Wed, Nov 11, 2020 at 01:46:25PM +0800, Liu Yinsi wrote:
On Tue, Nov 10, 2020 at 03:46:30PM +0800, Xiao Shenwei wrote:
[why] our os-cifs container will mount three dir, /srv/os /srv/initrd /srv/result it's may cause:
- our cifs service becomes slow
- 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
one container one service, put together in one start script has a little strange.
the three containers function very similarly, there is no need to divide it into folder. and if use three start file, start_os start_initrd start_result
sparrow inconvenient to handle
Thanks, Shenwei
Thanks, Yinsi
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[@]}"
2.23.0