FreeKB - Docker docker logs command
Docker - docker logs command

This assumes you have installed Docker on LinuxDocker is running, and that you have created a container. The docker logs command is used to view a containers logs. You may want to first issue the docker ps command to get the name of the containers.

The docker ps command can be used to determine if the container is running.

docker ps

CONTAINER ID     IMAGE              COMMAND                 CREATED         STATUS     PORTS     NAMES
d937372c09ab9    b939aa938add9913   "/docker-entrypoin..."  6 minutes ago   Created              my-container


In this example, the logs for the container named my-container will be displayed.

docker logs my-container


Often, the -t or --timestamps option is included.

docker logs --timestamps my-container


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 49dc5 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |