snap:编辑docker配置

kal*_*net 6 configuration read-only snap

我想配置我的 docker 守护进程。为此,我必须修改 daemon.json 文件,但不幸的是,它位于以只读方式安装的文件系统上;

root@shinwey:/snap/docker/current/config# ls -ltr
total 1
-rw-r--r-- 1 root root 72 Jun  8 22:18 daemon.json

root@shinwey:/snap/docker/current/config# touch daemon.json 
touch: cannot touch 'daemon.json': Read-only file system

root@shinwey:/snap/docker/current/config# df .
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/loop3        128896 128896         0 100% /snap/docker/471
Run Code Online (Sandbox Code Playgroud)

我尝试使用“snap get docker”,因为该命令处理配置,但没有成功;

root@shinwey:/snap/docker/current/config# snap get docker 
error: snap "docker" has no configuration
Run Code Online (Sandbox Code Playgroud)

是否有任何特定的“snap”命令来更新应用程序配置?

任何帮助将不胜感激

Koe*_*oen 12

https://github.com/docker-archive/docker-snap/issues/22

提到 daemon.json 文件应该位于此文件夹中:

/var/snap/docker/current/etc/docker/daemon.json

或者

/var/snap/docker/current/config/daemon.json

考虑到您随后需要进行的更改

sudo snap restart docker
Run Code Online (Sandbox Code Playgroud)