想把新硬盘挂载到docker上作为qbittorrent下载目录,结果搜了一遍要么说只能新建一个container,要么就是用啥hack方法麻烦得很,找到一个简单方法:
1. 停掉doker服务,用命令或者界面(群晖直接在界面关掉docker应用)
debian/ubuntu可以用命令
systemctl stop docker.service
2. 编辑特定container的配置文件,例如
vim /volume1/@docker/containers/0eb83a1f7d58ed1c801ac6cb6e14dbe54469ca434ca6e709270bb09ac8300273/config.v2.json
如果想将本机的/home/newfolder
挂载docker的/mnt
目录,则给MountPoints
新增一个:
"MountPoints":{"/mnt":{"Source":"/home/newfolder","Destination":"/mnt","RW":true,"Name":"","Driver":"","Type":"bind","Propagation":"rprivate","Spec":{"Type":"bind","Source":"/home/newfolder","Target":"/mnt"},"SkipMountpointCreation":false}}
3. 开启docker服务,群晖可以直接在图形界面点开始
4. 这时候如果还没法写入,可以给挂载的目录赋予更高的读写权限(比如777)
sudo chmod -R 777 /home/newfolder
评论前必须登录!
立即登录 注册