The exit code is not from Docker, it is from the process in the container. Commenting because this shows up in google searches. You'll see this exit code when you do a docker stop and the initial graceful stop
idContainer's ID nameContainer's name labelAn arbitrary string representing either a key or a key-value pair. Expressed as<key>or<key>=<value> exitedAn integer representing the container's exit code. Only useful with--all. statusOne ofcreated,restarting,running,removing,paused,exited, ordead...
id Container's ID name Container's name label An arbitrary string representing either a key or a key-value pair. Expressed as <key> or <key>=<value> exited An integer representing the container's exit code. Only useful with --all. status One of created, restarting, running, removing, ...
Block until a container stops, then print its exit code # 截取容器停止时的退出状态值
工欲善其事必先利其器,本文我们首先来给大家介绍下docker中的常用命令,只用对这些常用命令非常熟悉我们才能更好的来使用docker。 1.帮助命令 首先我们来看看docker中的帮助命令 docker version docker info docker --help 2.镜像命令 接下来我们看看docker中常用的镜像命令。
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d4a1999ef83e mcr.microsoft.com/mssql/server:2025-latest "/opt/mssql/bin/perm..." 2 minutes ago Up 2 minutes 0.0.0.0:1433->1433/tcp, :::1433->1433/tcp sql1 如果STATUS列显示Up状态,则 SQL Server 正在容器中运行,并且在侦听PORTS列中...
top Lookup the running processes of a container # 查看容器中运行的进程信息 unpause Unpause a paused container # 取消暂停容器 version Show the docker version information # 查看 docker 版本号 wait Block until a container stops, then print its exit code # 截取容器停止时的退出状态值 ...
unpause Unpause all processes within a container #取消暂停容器 version Show the Docker version information#查看容器版本号 wait Block until a container stops, then print its exit code #截取容器停止时的退出状态值 Run'docker COMMAND --help'formore information on a command. #运行docker命令在帮助可以获...
logs Fetch the logs of a container # 输出当前容器日志信息 port Lookup the public-facing port which is NAT-ed to PRIVATE_PORT # 查看映射端口对应的容器内部源端口 pause Pause all processes within a container # 暂停容器 ps List containers # 列出容器列表 ...
然后通过docker logs查询日志[root@iZ2ze8f268fd4hso5clji8Z~]# docker run-d centos/bin/bash-c"while true; do echo test; sleep 1; done"730ee45df27df144eb7533d1f5b0676c79fac68546e84dfff7ba9b2a16f933e2[root@iZ2ze8f268fd4hso5clji8Z~]# docker psCONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTS...