其他
【举栗子】Docker 容器磁盘占满的几种情况 | CSDN博文精选
参考文档:
https://docs.docker.com/engine/reference/commandline/dockerd/
$ sudo dockerd --storage-opt dm.basesize=50G
$ sudo service docker stop$ sudo rm -rf /var/lib/docker$ sudo service docker start
日志文件的路径形如:
/var/lib/docker/containers/CONTAINER_ID/CONTAINER_ID-json.log
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3",
"labels": "production_status",
"env": "os,customer"
}
}
日志配置参考:
https://docs.docker.com/config/containers/logging/configure/
完整daemon.json 示例参考:https://docs.docker.com/engine/reference/commandline/dockerd/
{
"authorization-plugins": [],
"data-root": "",
"dns": [],
"dns-opts": [],
"dns-search": [],
"exec-opts": [],
"exec-root": "",
"experimental": false,
"features": {},
"storage-driver": "",
"storage-opts": [],
"labels": [],
"live-restore": true,
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file":"5",
"labels": "somelabel",
"env": "os,customer"
},
"mtu": 0,
"pidfile": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"max-concurrent-downloads": 3,
"max-concurrent-uploads": 5,
"default-shm-size": "64M",
"shutdown-timeout": 15,
"debug": true,
"hosts": [],
"log-level": "",
"tls": true,
"tlsverify": true,
"tlscacert": "",
"tlscert": "",
"tlskey": "",
"swarm-default-advertise-addr": "",
"api-cors-header": "",
"selinux-enabled": false,
"userns-remap": "",
"group": "",
"cgroup-parent": "",
"default-ulimits": {
"nofile": {
"Name": "nofile",
"Hard": 64000,
"Soft": 64000
}
},
"init": false,
"init-path": "/usr/libexec/docker-init",
"ipv6": false,
"iptables": false,
"ip-forward": false,
"ip-masq": false,
"userland-proxy": false,
"userland-proxy-path": "/usr/libexec/docker-proxy",
"ip": "0.0.0.0",
"bridge": "",
"bip": "",
"fixed-cidr": "",
"fixed-cidr-v6": "",
"default-gateway": "",
"default-gateway-v6": "",
"icc": false,
"raw-logs": false,
"allow-nondistributable-artifacts": [],
"registry-mirrors": [],
"seccomp-profile": "",
"insecure-registries": [],
"no-new-privileges": false,
"default-runtime": "runc",
"oom-score-adjust": -500,
"node-generic-resources": ["NVIDIA-GPU=UUID1", "NVIDIA-GPU=UUID2"],
"runtimes": {
"cc-runtime": {
"path": "/usr/bin/cc-runtime"
},
"custom": {
"path": "/usr/local/bin/my-runc-replacement",
"runtimeArgs": [
"--debug"
]
}
},
"default-address-pools":[{"base":"172.80.0.0/16","size":24},
{"base":"172.90.0.0/16","size":24}]
}
docker-compose 配置参考:
https://docs.docker.com/compose/compose-file/compose-file-v2/
logging:
options:
max-size: '12m'
max-file: '5'
driver: json-file
推荐阅读:
如果批评《说好不哭》不自由,则赞美周杰伦无意义 聊聊困扰很多同学的一个问题:是否要转方向 ? 不服!身边程序员同事竟说自己敲代码速度快!Ctrl+C、Ctrl+V ?
如何解决多机房、多网络下的物联网部署方案? 从4个维度深度剖析闪电网络现状,在CKB上实现闪电网络的理由 | 博文精选
华为印度主管称准备与该国签署“无后门”协议;苹果回应向腾讯传输数据;Google 宣布将 AMP 项目交给 OpenJS ……