Add debug skills

pull/402/head
Baohua Yang 2018-12-26 10:05:42 +08:00
parent 9899c7028e
commit e2d5a2dff0
4 changed files with 38 additions and 6 deletions

View File

@ -1,9 +1,12 @@
## 主要修订记录
* 1.0.0: 2018-12-31
* 全面支持 v18.x 新版本
* 添加如何调试 Docker 附录
* 错误修正
* 0.9.0: 2017-12-31
* 对 v1.13.x 旧版本的最后支持
* 0.9.0-rc2: 2017-12-10

View File

@ -158,4 +158,4 @@
* [附录三Docker 命令查询](appendix/command/README.md)
* [附录四Dockerfile 最佳实践](appendix/best_practices.md)
* [附录五:资源链接](appendix/resources/README.md)
* [附录六:Docker 中文资源](appendix/resources/cn.md)
* [附录六:如何调试 Docker](appendix/debug.md)

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)