This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
docker [2021/08/28 11:00] – [Change the default log policy] alexk7110 | docker [2022/05/28 18:32] (current) – alexk7110 | ||
---|---|---|---|
Line 17: | Line 17: | ||
docker system df | docker system df | ||
</ | </ | ||
- | ==== List all containers ==== | + | ==== List all containers, running or stopped |
<code bash> | <code bash> | ||
docker ps -a | docker ps -a | ||
Line 26: | Line 26: | ||
{{.Networks}}\t{{.Ports}}\t{{.Size}}" | {{.Networks}}\t{{.Ports}}\t{{.Size}}" | ||
</ | </ | ||
- | ==== Follow | + | ==== Follow |
<code bash> | <code bash> | ||
docker logs -f container_name | docker logs -f container_name | ||
</ | </ | ||
- | ==== Information on a network ==== | + | |
- | <code bash> | + | |
- | docker network inspect network_name | + | |
- | </ | + | |
==== Information on a container ==== | ==== Information on a container ==== | ||
<code bash> | <code bash> | ||
Line 47: | Line 44: | ||
<code bash> | <code bash> | ||
docker network prune | docker network prune | ||
+ | </ | ||
+ | ==== Get network information ==== | ||
+ | <code bash> | ||
+ | docker network inspect network_name | ||
</ | </ | ||
---- | ---- | ||
Line 78: | Line 79: | ||
<code bash> | <code bash> | ||
docker search ruby --filter=" | docker search ruby --filter=" | ||
- | </ | + | </ |
+ | ==== Use the first 4 letters of a container hash to reference it ==== | ||
+ | <code bash> | ||
+ | docker image inspect f4f4 | ||
+ | </ | ||
+ | You only need to reference the first 4 characters of the ID for it to work. | ||
---- | ---- | ||
Line 103: | Line 109: | ||
This will keep 10Gb of log files, so adjust accordingly | This will keep 10Gb of log files, so adjust accordingly | ||
- | Then restart Docker and you’ll be good to go. | + | Then restart Docker |
---- | ---- | ||
- | ==== Use the first 4 letters of a container hash to reference it ==== | ||
- | <code bash> | ||
- | docker image inspect f4f4 | ||
- | </ | ||
- | You only need to reference the first 4 characters of the ID for it to work. | ||
- | ---- | ||
==== Great site with tips, where some of the above ones are coming from ==== | ==== Great site with tips, where some of the above ones are coming from ==== | ||
https:// | https:// |