How to find the CMD command of a docker image?

You can use the docker inspect command

docker inspect --format="{{.Config.Cmd}}" <image:tag>
docker inspect -f '{{.Config.Cmd}}' <image:tag>

That is used, for instance, to “list full command of running/stopped container in Docker”.


As noted in the comments by user2915097 and Lenormju, an alternative would be, using docker history --no-trunc:

docker history --no-trunc zenithar/nano-nginx | awk ' NR==2 {print}'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)