Sunday, 19 May 2019

Docker: How to see the logs of container?


Syntax
docker container logs {containerName/containerID}

Execute the command ‘docker container ls -a’ to list all the containers.

$docker container ls -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                     NAMES
8ff3181fef3e        jboss/wildfly       "/opt/jboss/wildfly/…"   12 hours ago        Up 12 hours         0.0.0.0:32768->8080/tcp   naughty_poitras

Execute either of below commands to see the logs of container.
docker container logs naughty_poitras
docker container logs 8ff3181fef3e



Previous                                                 Next                                                 Home

No comments:

Post a Comment