Docker Where are the Docker daemon logs?
Troubleshoot the daemon
You can enable debugging on the daemon to learn about the runtime activity of the daemon and to aid in troubleshooting. If the daemon is completely non-responsive, you can also force a full stack trace of all threads to be added to the daemon log by sending the SIGUSR
signal to the Docker daemon.
Out Of Memory Exceptions (OOME)
If your containers attempt to use more memory than the system has available, you may experience an Out Of Memory Exception (OOME) and a container, or the Docker daemon, might be killed by the kernel OOM killer. To prevent this from happening, ensure that your application runs on hosts with adequate memory and see Understand the risks of running out of memory.
Read the logs
The daemon logs may help you diagnose problems. The logs may be saved in one of a few locations, depending on the operating system configuration and the logging subsystem used:
Operating system | Location |
---|---|
RHEL, Oracle Linux | /var/log/messages |
Debian | /var/log/daemon.log |
Ubuntu 16.04+, CentOS | Use the command journalctl -u docker.service |
Ubuntu 14.10- | /var/log/upstart/docker.log |
macOS | ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/console-ring |
Windows | AppData\Local |
Enable debugging
There are two ways to enable debugging. The recommended approach is to set the debug
key to true
in the daemon.json
file. This method works for every Docker platform.
-
Edit the
daemon.json
file, which is usually located in/etc/docker/
. You may need to create this file, if it does not yet exist. On macOS or Windows, do not edit the file directly. Instead, go to Preferences / Daemon / Advanced. -
If the file is empty, add the following:
{ "debug": true}
If the file already contains JSON, just add the key
"debug": true
, being careful to add a comma to the end of the line if it is not the last line before the closing bracket. Also verify that if thelog-level
key is set, it is set to eitherinfo
ordebug
.info
is the default, and possible values aredebug
,info
,warn
,error
,fatal
. -
Send a
HUP
signal to the daemon to cause it to reload its configuration. On Linux hosts, use the following command.$ sudo kill -SIGHUP $(pidof dockerd)
On Windows hosts, restart Docker.
Instead of following this procedure, you can also stop the Docker daemon and restart it manually with the -D
flag. However, this may result in Docker restarting with a different environment than the one the hosts’ startup scripts will create, and this may make debugging more difficult.
Force a stack trace to be logged
If the daemon is unresponsive, you can force a full stack trace to be logged by sending a SIGUSR1
signal to the daemon.
-
Linux:
$ sudo kill -SIGUSR1 $(pidof dockerd)
-
Windows Server:
Download docker-signal.
Run the executable with the flag
--pid=<PID of daemon>
.
This will force a stack trace to be logged but will not stop the daemon. Daemon logs will show the stack trace or the path to a file containing the stack trace if it was logged to a file.
The daemon will continue operating after handling the SIGUSR1
signal and dumping the stack traces to the log. The stack traces can be used to determine the state of all goroutines and threads within the daemon.
View stack traces
The Docker daemon log can be viewed by using one of the following methods:
-
By running
journalctl -u docker.service
on Linux systems usingsystemctl
-
/var/log/messages
,/var/log/daemon.log
, or/var/log/docker.log
on older Linux systems -
By running
Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object Time
on Docker EE for Windows Server
Note: It is not possible to manually generate a stack trace on Docker for Mac or Docker for Windows. However, you can click the Docker taskbar icon and choose Diagnose and feedback to send information to Docker if you run into issues.
Look in the Docker logs for a message like the following:
...goroutine stacks written to /var/run/docker/goroutine-stacks-2017-06-02T193336z.log ...daemon datastructure dump written to /var/run/docker/daemon-data-2017-06-02T193336z.log
The locations where Docker saves these stack traces and dumps depends on your operating system and configuration. You may be able to get useful diagnostic information straight from the stack traces and dumps. Otherwise, you can provide this information to Docker for help diagnosing the problem.
Check whether Docker is running
The operating-system independent way to check whether Docker is running is to ask Docker, using the docker info
command.
You can also use operating system utilities, such as sudo systemctl is-active docker
or sudo status docker
orsudo service docker status
, or checking the service status using Windows utilities.

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
开源硬件相关平台
可见有如下几种,当然树莓派由于直至再用,这里不做补充: 1.UDOO: 4倍树莓派性能+Android/Linux全兼容+Arduino开发,UDOO打造极客个人电脑DIY新高度,为教育、创新行业提供强大支撑。 今天为大家介绍的新奇玩物名叫UDOO,它是一台与此前鼎鼎大名的树梅派功能相似的迷你电脑。UDOO主板内置i.MX6 Freescale处理器和Arduino开发板,可以运行Android和Linux操作系统,而且价格低廉,非常适合教育、创新、IT行业和各路 Geek使用。 UDOO非常适合软件开发和程序设计,简单易用,不需要非常多的背景知识。UDOO将不同的操作系统融合在一起,每个操作系统自身的优势和劣势都可以被用户极好地把握,更好地发挥不同的操作系统的功能。 UDOO属于开源硬件的一部分,搭载ARM i.MX6 Freescale处理器,主板上同时还带有一颗Arduino DUE出品的ARM SAM3X处理器,能够满足Android和Linux操作系统的性能需求。 其尺寸非常小,只有11cm x 8.5m,功耗也低。 目前UDOO迷你电脑正在Kickstarter上募资,...
- 下一篇
centos 7 安装docker 并设置阿里云镜像仓库
centos 7 安装docker 并设置阿里云镜像仓库 yum install -y wget yum update yum install -y deltarpm ============================================================================================================================================== Ubuntu 14.04 16.04 (使用apt-get进行安装) # step 1: 安装必要的一些系统工具 sudo apt-get update sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common # step 2: 安装GPG证书 curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - #...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- 设置Eclipse缩进为4个空格,增强代码规范
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS7设置SWAP分区,小内存服务器的救世主
- CentOS8编译安装MySQL8.0.19
- CentOS7,8上快速安装Gitea,搭建Git服务器
- Eclipse初始化配置,告别卡顿、闪退、编译时间过长
- SpringBoot2更换Tomcat为Jetty,小型站点的福音
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2全家桶,快速入门学习开发网站教程