November 2018
Beginner
230 pages
6h 4m
English
When you run a container in the foreground, all of the output the container sends to standard output and standard error is displayed in the console for the session that ran the container. However, when you use the --detach parameter, control of the session is returned as soon as the container starts so you don't see the data sent to stdout and stderr. If you want to see that data, you use the container logs command. That command looks like this:
# the long form of the command# Usage: docker container logs [OPTIONS] CONTAINERdocker container logs --follow --timestamps web-server# the short form of the commanddocker container logs -f -t web-server# get just the last 5 lines (there is no short form for the "--tail" ...
Read now
Unlock full access