Add debug skills

This commit is contained in:
Baohua Yang
2018-12-26 10:05:42 +08:00
parent 9899c7028e
commit e2d5a2dff0
4 changed files with 38 additions and 6 deletions

34
appendix/debug.md Normal file
View 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)
```

View File

@@ -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)