标题: docker查看容器完整command的命令 [打印本页] 作者: 郑全 时间: 2019-9-7 22:22 标题: docker查看容器完整command的命令 jadmin@TJ-Server:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9cc60235e95a tomcat6 "/opt/tomcat6/bin/ca…" 8 months ago Up 2 hours 0.0.0.0:8000->8000/tcp, 0.0.0.0:8010->8010/tcp, 8020/tcp tomcat_tj
fb3d59ea6bc2 redis "docker-entrypoint.s…" 8 months ago Up 2 hours 0.0.0.0:6379->6379/tcp redis
a70ea2891a30 oracle_db "/bin/sh -c 'exec $O…" 8 months ago Up 2 hours 0.0.0.0:1521->1521/tcp oracle
tjadmin@TJ-Server:~$
上面看到的命令,不完整,要看完整的,看看帮助
jadmin@TJ-Server:~$ sudo docker ps --help
Usage: docker ps [OPTIONS]
List containers
Options:
-a, --all Show all containers (default shows just running)
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print containers using a Go template
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display numeric IDs
-s, --size Display total file sizes
加一个 --no-trunc即可
tjadmin@TJ-Server:~$ sudo docker ps --no-trunc
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9cc60235e95aaafc5e98b22808ae4e6f0fda56039e0a8085cadfe60157bbd353 tomcat6 "/opt/tomcat6/bin/catalina.sh jpda run" 8 months ago Up 2 hours 0.0.0.0:8000->8000/tcp, 0.0.0.0:8010->8010/tcp, 8020/tcp tomcat_tj
fb3d59ea6bc235cfda5a03e05c74bac08c0be8a49f30a9e04ae626ff6eee6b95 redis "docker-entrypoint.sh --requirepass PhysicalExamination" 8 months ago Up 2 hours 0.0.0.0:6379->6379/tcp redis,tomcat_tj/redis
a70ea2891a305e6c16c50e2b1d5ca35d52627a1caaea9930948f22369b57b60a oracle_db "/bin/sh -c 'exec $ORACLE_BASE/$RUN_FILE'" 8 months ago Up 2 hours 0.0.0.0:1521->1521/tcp oracle,tomcat_tj/oracle
tjadmin@TJ-Server:~$