mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-02 14:01:49 +00:00
Add debug skills
This commit is contained in:
34
appendix/debug.md
Normal file
34
appendix/debug.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# 如何调试 Docker
|
||||
|
||||
## 开启 Debug 模式
|
||||
|
||||
在 dockerd 配置文件 daemon.json(默认位于 /etc/docker/)中添加
|
||||
|
||||
```json
|
||||
{
|
||||
"debug": true
|
||||
}
|
||||
```
|
||||
|
||||
重启守护进程。
|
||||
|
||||
```bash
|
||||
$ sudo kill -SIGHUP $(pidof dockerd)
|
||||
```
|
||||
|
||||
此时 dockerd 会在日志中输入更多信息供分析。
|
||||
|
||||
## 检查内核日志
|
||||
|
||||
```bash
|
||||
$ sudo dmesag |grep dockerd
|
||||
$ sudo dmesag |grep runc
|
||||
```
|
||||
|
||||
## Docker 不响应时处理
|
||||
|
||||
可以杀死 dockerd 进程查看其堆栈调用情况。
|
||||
|
||||
```bash
|
||||
$ sudo kill -SIGUSR1 $(pidof dockerd)
|
||||
```
|
@@ -1,5 +0,0 @@
|
||||
# Docker 中文资源
|
||||
|
||||
* [Docker 问答录(100 问)](https://blog.lab99.org/post/docker-2016-07-14-faq.html)
|
||||
|
||||
* [Docker CE 变更日志中文翻译](https://github.com/allencloud/docker-changelog-chinese)
|
Reference in New Issue
Block a user