Home  >  Article  >  Operation and Maintenance  >  How to check the error report in docker?

How to check the error report in docker?

coldplay.xixi
coldplay.xixiOriginal
2020-06-12 15:56:572931browse

How to check the error report in docker?

How to check the error report in docker?

How to view error reports in docker:

1. Log in to the docker host to analyze the problem

1. Start the iframe-test machine

root@ubuntu:~#docker start iframe-test
iframe-test

2. Found that there is no container process

root@ubuntu:~#docker ps |grep iframe-test

3. Check the log and find that there is a problem with nginx configuration, causing the interruption.

root@ubuntu:~# docker logs iframe-test
Startingnginx: Starting periodic command scheduler: cron.
nginx:[emerg] unexpected end of file, expecting ";" or "}" in/etc/nginx/nginx.conf:21
nginx:configuration file /etc/nginx/nginx.conf test failed

2. Fault prompts when starting docker container

[root@server opt]# docker run -it --rm --name aa centos:latest
/usr/bin/docker-current: Error response from daemon: shim error: docker-runc not installed on system.

Solution

[root@server opt]# cd /usr/libexec/docker/
[root@server docker]# sudo ln -s docker-runc-current docker-runc

3. Insufficient memory for docker container

Docker startup requires at least 2G memory. First execute the free -mh command to check whether the remaining memory is enough

Check the memory directly

$free -mh
total used free shared buff/cache available
Mem: 15G 14G 627M 195M 636M 726M
Swap: 0B 0B 0B

Analyze the log

Sometimes the memory is overloaded and overflowed in a moment, causing some processes to be killed. It seems that the memory is sufficient. In fact, docker will still restart repeatedly, which requires further analysis through the docker log and system log information.

Recommended tutorial: "docker video tutorial"

The above is the detailed content of How to check the error report in docker?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn