- 自宅用の誰でもアクセスできるNAS的なやつを手軽に作る。仕事で使うなら、最低パスワードぐらいかけたほうが良いかな
- https://hub.docker.com/r/vimagick/samba
- docker-compose.yml
version: "3.9"
services:
samba:
image: vimagick/samba
volumes:
- /data/samba/smb.conf:/etc/samba/smb.conf
- /data/samba/share:/share
tty: yes
network_mode: "host"
restart: always
- /data/samba/smb.conf
[global]
netbios name = gpu1
workgroup = WORKGROUP
server string = GPU1 Samba Server
server role = standalone
map to guest = bad user
usershare allow guests = yes
[homes]
comment = Home Directories
browseable = no
writable = yes
[share]
comment = Public File Sharing
path = /share
browseable = yes
writable = yes
read only = no
guest ok = yes
admin users = root
create mode = 0777
directory mode = 0777
- ディレクトリのパーミッション設定
# chmod -R 777 /data/samba/share
- パスワード設定
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
219a2826d849 vimagick/samba "/bin/sh -c 'nmbd -D…" 52 seconds ago Up 50 seconds docker_samba_samba_1
a21b429d9bb4 sonatype/nexus3 "sh -c ${SONATYPE_DI…" 8 days ago Up 53 minutes 0.0.0.0:8081->8081/tcp, :::8081->8081/tcp docker_nexus3_nexus_1
# docker exec -it docker_samba_samba_1 sh
/ # testparam
sh: testparam: not found
/ # smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.
/ # exit
- Chromebook からのマウント
設定 > 詳細設定 > ファイル > ネットワークファイル共有 > ファイル共有を追加