mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-23 22:51:53 +00:00
Update cheatsheets
This commit is contained in:
29
docker-logs
Normal file
29
docker-logs
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# docker logs
|
||||
|
||||
> Print container logs.
|
||||
> More information: <https://docs.docker.com/engine/reference/commandline/logs>.
|
||||
|
||||
- Print logs from a container:
|
||||
|
||||
`docker logs {{container_name}}`
|
||||
|
||||
- Print logs and follow them:
|
||||
|
||||
`docker logs -f {{container_name}}`
|
||||
|
||||
- Print last 5 lines:
|
||||
|
||||
`docker logs {{container_name}} --tail {{5}}`
|
||||
|
||||
- Print logs and append them with timestamps:
|
||||
|
||||
`docker logs -t {{container_name}}`
|
||||
|
||||
- Print logs from a certain point in time of container execution (i.e. 23m, 10s, 2013-01-02T13:23:37):
|
||||
|
||||
`docker logs {{container_name}} --until {{time}}`
|
||||
Reference in New Issue
Block a user