If the container emits logs or output on STDOUT/STDERR, then we can get them without logging into the container.
Looking at the container logs
Getting ready
Ensure that the Docker daemon is running on the host and can be connected through the Docker client. You will also need a running container, that emits logs/output on STDOUT.
How to do it...
To get logs from the container, run the following command:
docker container logs [OPTIONS] CONTAINER
Or run the following legacy command:
docker logs [OPTIONS] CONTAINER
Let's take an example from the earlier section...