How to check the error report in docker?

coldplay.xixi
Release: 2020-06-30 09:36:33
Original
3018 people have browsed it

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
Copy after login

2. Found that there is no container process

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

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
Copy after login

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.
Copy after login

Solution

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

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!