查看某个容器的详细信息
docker inspect 657f23bba0c6
进入默认容器的配置文件目录
C#代码
- cd /var/lib/docker/containers/657f23bba0c6ddc002c0b2f57c23edd36be742f9777f5ed9b755538085c419b0
我们将要修改的文件就是config.v2.json和hostconfig.json
修改config.v2.json
调出冒号命令,输入如下(这里注意,shift+:),%!python -m json.tool
====================================
C#代码
- "MountPoints": {
- ...,
- "/data/rsync": {
- "Destination": "/data/rsync",
- "Driver": "",
- "Name": "",
- "Propagation": "rprivate",
- "RW": true,
- "SkipMountpointCreation": false,
- "Source": "/data/apps/rsync",
- "Spec": {
- "Source": "/data/apps/rsync",
- "Target": "/data/rsync",
- "Type": "bind"
- },
- "Type": "bind"
- }
- }
修改hostconfig.json
调出冒号命令,输入如下(这里注意,shift+:),%!python -m json.tool
C#代码
- "AutoRemove": false,
- "Binds": [
- "/data/apps/nginx/htdocs:/data/nginx/htdocs",
- "/data/apps/redis/htdocs:/data/redis/htdocs",
- "/data/apps/nodejs/htdocs/nest/other:/data/nodejs/htdocs/nest/other",
- "/data/apps/nodejs/htdocs/nest/do_nest/public/www:/data/nodejs/htdocs/nest/do_nest/public/www",
- "/data/apps/nodejs/htdocs/nest/KTM/dist:/data/nodejs/htdocs/nest/KTM/dist",
- "/data/apps/nodejs/htdocs/nest/KTM/public:/data/nodejs/htdocs/nest/KTM/public",
- "/data/apps/rsync:/data/rsync"
- ],
先关闭docker服务
C#代码
- systemctl start docker
- systemctl stop docker
- systemctl stop docker.socket
- systemctl enable docker.service