[关闭]
@bergus 2016-01-19T11:19:36.000000Z 字数 804 阅读 2102

搭建简单的smb服务器

smb


Dockerfile

  1. FROM debian:jessie
  2. MAINTAINER Jens Erat <email@jenserat.de>
  3. VOLUME /srv
  4. EXPOSE 137 138 139 445
  5. ENV DEBIAN_FRONTEND noninteractive
  6. RUN \
  7. apt-get update && \
  8. apt-get install --no-install-recommends -y samba && \
  9. apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/
  10. COPY smb.conf /etc/samba/smb.conf
  11. # Pregenerate password database to prevent warning messages on container startup
  12. RUN /usr/sbin/smbd && sleep 10 && smbcontrol smbd shutdown
  13. ENTRYPOINT /usr/sbin/smbd -FSD -d1 --option=workgroup=${workgroup:-workgroup}

smb.conf

  1. [global]
  2. load printers = no
  3. printing = bsd
  4. printcap name = /dev/null
  5. disable spoolss = yes
  6. map to guest = bad user
  7. [public]
  8. path = /root/share
  9. guest ok = yes
  10. writeable = yes
  11. browseable = yes
  12. create mask = 0666
  13. directory mask = 0777

run

  1. docker run -d \
  2. --publish 445:445 \
  3. --publish 137:137 \
  4. --publish 138:138 \
  5. --publish 139:139
  6. --volume /tmp:/root/share \
  7. --name smb \
  8. samba:v1
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注