How do you display logs of a docker container?

Experience Level: Junior
Tags: DockerDocker CLI

Answer

Run the following command to get a list of containers:

docker ps

Find the container you want to get logs from and get its ID.

Run the following command to display logs:

docker logs ContainerID

Comments

No Comments Yet.
Be the first to tell us what you think.
Docker for beginners
Docker for beginners

Are you learning Docker ? Try our test we designed to help you progress faster.

Test yourself
Kubernetes Certified Application Developer (CKAD) preparation
Kubernetes Certified Application Developer (CKAD) preparation

Are you learning Docker ? Try our test we designed to help you progress faster.

Test yourself