Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get `docker run` full arguments?

Tags:

docker

For example, I run a docker by docker run -d --name sonarqube -p 19000:9000 -p 19002:9002 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD=123 --link sonarqube-mysql:mysql.

Then I lost my shell command history, but I want to know all my arguments. How can I get them? (I need the arguments to copy/move/restart container)

like image 367
Fancyoung Avatar asked Dec 04 '25 14:12

Fancyoung


2 Answers

Of course docker inspect is the way to go, but if you just want to "reconstruct" the docker run command, you have

https://github.com/nexdrew/rekcod

it says

Reverse engineer a docker run command from an existing container (via docker inspect).

like image 114
user2915097 Avatar answered Dec 06 '25 04:12

user2915097


docker inspect CONTAINER_NAME gives you that information.

Check docker inspect reference to see all available options: https://docs.docker.com/engine/reference/commandline/inspect/

like image 26
kstromeiraos Avatar answered Dec 06 '25 02:12

kstromeiraos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!