Tutorial by Examples

To get all the information for a container you can run: docker inspect <container>
You can get an specific information from a container by running: docker inspect -f '<format>' <container> For instance, you can get the Network Settings by running: docker inspect -f '{{ .NetworkSettings }}' <container> You can also get just the IP address: docker inspect ...
In order to inspect an image, you can use the image ID or the image name, consisting of repository and tag. Say, you have the CentOS 6 base image: ➜ ~ docker images REPOSITORY TAG IMAGE ID CREATED SIZE centos centos6 cf2c3...
docker inspect supports Go Templates via the --format option. This allows for better integration in scripts, without resorting to pipes/sed/grep traditional tools. Print a container internal IP: docker inspect --format '{{ .NetworkSettings.IPAddress }}' 7786807d8084 This is useful for direct ne...
docker inspect command can be used to debug the container logs. The stdout and stderr of container can be checked to debug the container, whose location can be obtained using docker inspect. Command : docker inspect <container-id> | grep Source It gives the location of containers stdout an...
docker logs --follow <containerid> This tails the output of the running container. This is useful if you did not set up a logging driver on the docker daemon.

Page 1 of 1