查看正在运行的docker容器启动的run命令的几种方法
1.使用带格式化的inspect命令docker inspect \--format "$(curl -s https://gist.githubusercontent.com/efrecon/8ce9c75d518b6eb863f667442d7bc679/raw/run.tpl)" \YOUR-CONTAINER2.使用docker run命令docker run --rm -v /var/r
·
1.使用带格式化的inspect命令
docker inspect \
--format "$(curl -s https://gist.githubusercontent.com/efrecon/8ce9c75d518b6eb863f667442d7bc679/raw/run.tpl)" \
<容器名>|<容器ID>
2.使用docker run命令
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro \
assaflavie/runlike <容器名>|<容器ID>
或者
alias runlike="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro assaflavie/runlike"
runlike <容器名>|<容器ID>
3.安装runlike软件
sudo apt install python-pip
sudo pip install runlike
runlike -p <容器名>|<容器ID>
参考
https://stackoverflow.com/questions/32758793/how-to-show-the-run-command-of-a-docker-container#
更多推荐
所有评论(0)