Steps for docker container exit error code

Steps for docker container exit error code

Sometimes some docker containers exit after a period of execution. In order to find out the reason, check the error code of the docker container exit. The specific steps are as follows:

1. Find the exited container. You can find it in the following two ways:

docker ps --filter "status=exited"

docker ps -a | grep container name

2. Execute the docker inspect container id command to view the exited container information

docker inspect container id, check the State part

The State section shows the status of the container, OOMKilled, ExitCode and other information. The following is a common ExitCode of Docker

  • Exit Code 0 : In many cases, it may just be the normal exit of the program
  • Exit Code 1 : Application startup failed, such as failure to connect to the database at startup, failure to register nacos, etc.
  • Exit Code 137 : The container received a SIGKILL signal. For example, the system killed the container when the container usage was too high. It could also be a Dockerfile problem, where a non-existent file was accessed, such as ENTRYPOINT ["java","-jar","sample.ja"] missing the regexp.
  • Exit Code 139 : The container received a SIGSEGV signal, such as a program accessing memory beyond the bounds, but the running system did not catch the corresponding error. Exit Code 255: An error occurred in the container, but the cause of the error is uncertain. In this case, you can view the container logs through docker logs container id to see if you can find any clues.

PS: Let’s take a look at the errors encountered when creating a docker container

1. Screenshot of the problem

2. Description of the problem This problem is caused by the incompatibility between the Docker version and the system version.

The current system version and docker version are as follows:

3. Problem Solving

The problem can be solved by installing a lower version of docker or a higher version of the system (Centos7.4 or above).

Install the lower version of docker address: https://www.jb51.net/article/219364.htm

This is the end of this article about docker container error codes. For more relevant docker error code content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of several storage methods of docker containers
  • Docker container data volume named mount and anonymous mount issues
  • A Brief Analysis of Patroni in Docker Containers

<<:  jQuery solves the problem of not executing the original event after adding elements

>>:  MySql cache query principle and cache monitoring and index monitoring introduction

Recommend

Analysis of the process of simply deploying nginx in Docker container

1. Deploy nginx service in container The centos:7...

Graphic tutorial on installing CentOS7 on VMware 15.5

1. Create a new virtual machine in VMware 15.5 1....

The use and difference between JavaScript pseudo-array and array

Pseudo-arrays and arrays In JavaScript, except fo...

Do designers need to learn to code?

Often, after a web design is completed, the desig...

Tips for implementing list loop scrolling based on jQuery (super simple)

I saw a good idea and recorded it. I have used jQ...

Summary of various uses of JSON.stringify

Preface Anyone who has used json should know that...

How InnoDB cleverly implements transaction isolation levels

Preface In the previous article Detailed Explanat...

Detailed explanation of Javascript Echarts air quality map effect

We need to first combine the air quality data wit...

Tutorial diagram of installing CentOS and Qt in Vmware virtual machine

Vmware Installation Installing Packages Download ...

The images in HTML are directly replaced by base64 encoded strings

Recently, I came across a webpage that had images ...