[why] our os-cifs container will mount three dir, /srv/os, /srv/initrd, /srv/result in order to reduce the coupling, need split them
[how] one folder mount by one container
[usage] mount -t cifs o guest //ip/os /tmp/os mount -t cifs o guest //ip/os-rw /tmp/os-rw
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com --- container/os-cifs/Dockerfile | 8 ++++---- container/os-cifs/smb.conf | 26 ++------------------------ container/os-cifs/start | 7 +++---- 3 files changed, 9 insertions(+), 32 deletions(-)
diff --git a/container/os-cifs/Dockerfile b/container/os-cifs/Dockerfile index 66f978d..c22ce35 100644 --- a/container/os-cifs/Dockerfile +++ b/container/os-cifs/Dockerfile @@ -4,16 +4,16 @@
FROM alpine:edge
-RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweicloud.com%7Cg' /etc/apk/repositories +MAINTAINER Xiao Shenwei xiaoshenwei96@163.com
+RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweicloud.com%7Cg' /etc/apk/repositories RUN adduser -u 1090 -D lkp - RUN apk add --update \ samba-common-tools \ samba-client \ samba-server \ - bash \ - && rm -rf /var/cache/apk/* + bash +RUN rm -rf /var/cache/apk/*
COPY ./smb.conf /etc/samba/
diff --git a/container/os-cifs/smb.conf b/container/os-cifs/smb.conf index 5ff6841..5e454db 100644 --- a/container/os-cifs/smb.conf +++ b/container/os-cifs/smb.conf @@ -18,6 +18,7 @@ server min protocol = NT1 unix extensions = yes mangled names = no + [os] path = /srv/os/ comment = os @@ -28,6 +29,7 @@ # that can only be accessed by root. force user = root force group = root + [os-rw] path = /srv/os/ comment = os-rw @@ -36,27 +38,3 @@ public = yes force user = root force group = root -[initrd] - path = /srv/initrd/ - comment = initrd - browseable = yes - writable = yes - public = yes - force user = lkp - force group = lkp -[osimage] - path = /srv/initrd/ - comment = initrd - browseable = yes - writable = yes - public = yes - force user = lkp - force group = lkp -[result] - path = /srv/result/ - comment = result - browseable = yes - writable = yes - public = yes - force user = lkp - force group = lkp diff --git a/container/os-cifs/start b/container/os-cifs/start index f42c71c..5e08238 100755 --- a/container/os-cifs/start +++ b/container/os-cifs/start @@ -11,12 +11,11 @@ lsmod | grep -q "^cifs\s" || { docker_rm os-cifs
cmd=( - docker run -dt + docker run + -d -p 445:445 - -v /srv/os:/srv/os -v /etc/localtime:/etc/localtime:ro - -v /srv/initrd:/srv/initrd - -v /srv/result:/srv/result + -v /srv/os:/srv/os --name os-cifs --restart=always os-cifs