I display running containers using
docker ps
command. There is an IMAGE column that shows name of the image that each container was created from. However in the meantime (while containers were running) I have rebuilt some images. The new images have the same names but different IDs. Now I'd like to check from which image specific container was run. I cannot deduce this information using only image name. I need image ID. Is there any possibility to display ID of the image that was used to run specific container?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
You can pass multiple container-ids to the docker inspect command and then use the --format to only get the values that you want.
This will give you a list of the docker container Ids, names and image IDs that are being used for all of your containers.
https://docs.docker.com/engine/reference/commandline/inspect/
will show you the image names and their IDs
I found that
docker inspect <container-id>
can be used for this purpose. It displays an image field containing full hash.