docker查看已启动容器启动命令

方法一(只能看到部分信息):

docker ps -a --no-trunc 

方法二:
安装runlike
(查看指定docker container的启动命令)


pip install runlike
命令格式:runlike -p <容器名>|<容器ID>
[root@mq02 ~]# runlike -p 5f817b8d13eee52dd12ffdf8a1ff582ad95c5afd6db97c2a2380047e7252106
docker run \
        --name=magical_beaver \
        --hostname=7b9f6db0ad40 \
        --mac-address=02:42:ac:11:00:03 \
        --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin \
        --env=JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk \
        --env=JAVA_VERSION=8u171 \
        --env=JAVA_ALPINE_VERSION=8.171.11-r0 \
        --env=LANG=C.UTF-8 \
        -p 0.0.0.0:9090:8080 \
        -t \
        workcheng/hellojib:0.0.1-SNAPSHOT

补充
window10环境,安装runlike之后,使用命令提示找不到路径:


PS D:\work\code\wx-java-mp-demo-master> pip install runlike
Collecting runlike
  Downloading runlike-0.7.0-py3-none-any.whl (5.4 kB)
Collecting Click
Collecting colorama
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Installing collected packages: colorama, Click, runlike
  WARNING: The script runlike.exe is installed in 'C:\Users\lxk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed Click-8.0.1 colorama-0.4.4 runlike-0.7.0
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
3.9_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
PS D:\work\code\wx-java-mp-demo-master>  runlike -p 7b9f6db0ad4071509d2a930d7e2e06809e802c8fd32267d3a7b65211995b25c3
runlike : 无法将“runlike”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路
径正确,然后再试一次。
所在位置 行:1 字符: 2
+  runlike -p 7b9f6db0ad4071509d2a930d7e2e06809e802c8fd32267d3a7b652119 ...
+  ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (runlike:String) [], CommandNotFoundException

可以使用文件全局查找,找到runlike.exe:
我是使用everything全局查找,我的电脑中 runlike.exe 是在这个位置:

(C:\Users\lxk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts)

在这里打开一个terminal窗口,运行命令:

.\runlike.exe -p 7b9f6db0ad4071509d2a930d7e2e06809e802c8fd32267d3a7b65211995b25c3
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片