1.系统环境
centos 6.5(宿主) docker 1.7 centos(6.8 )镜像
2.问题
在查看docker 容器时候发现容器的状态好像有点不同,出现了一点困惑。
docker ps -a 回显信息中的status中:
docker 容器的退出状态出现好多种:
exit(0),exit(1),exit(2),exit(127),exit(137)等
只是有一个疑问:在都docker中是否也想linux中执行命令返回码一样,
0代表正常退出。其他代表非正常退出。
有没有详细的说明,解释一下这些退出状态有什么区别吗?
All Docker container runs will specify a running command, which is the startup command of the main process in the container, and the exit code in the container exit status is actually the exit code of this process. In other words, you can directly equate the exit code in Docker with the Linux execution return code.
Yes, it is the status code of Linux.
Appendix:
http://blog.chinaunix.net/uid...
The above link is a list of status codes.
This is the conventional status code, you can see it in /usr/include/errno.h.
actually
The status code of docker is not very useful. It means that it runs successfully or if there is a problem after running it, the container is terminated. If docker ps does not come out, it means the operation failed. Sometimes there is a configuration problem when mounting the file, but docker ps -a will come out. It's better to delete it, because next time you use the same container name, there will be a conflict and it will not be started.