Homelab Troubleshooting

Tips on running a Linux server and docker.

User Tools

Site Tools


docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker [2021/08/28 10:58] alexk7110docker [2022/05/28 18:32] (current) alexk7110
Line 17: Line 17:
 docker system df docker system df
 </code> </code>
-==== 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}}"
 </code> </code>
-==== Follow a container'log ====+==== Follow the log of your app ====
 <code bash> <code bash>
 docker logs -f container_name docker logs -f container_name
 </code> </code>
-==== Information on a network ==== +
-<code bash> +
-docker network inspect network_name   +
-</code>+
 ==== 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
 +</code>
 +==== Get network information ====
 +<code bash>
 +docker network inspect network_name  
 </code> </code>
 ---- ----
Line 62: Line 63:
 docker exec -it mybb_mybb_1 /bin/sh docker exec -it mybb_mybb_1 /bin/sh
 </code> </code>
-Stopping containers with specific name+==== Stopping containers with specific name ====
 <code bash> <code bash>
 docker container stop $(docker container ls -q --filter name=myapp*) docker container stop $(docker container ls -q --filter name=myapp*)
Line 78: Line 79:
 <code bash> <code bash>
 docker search ruby --filter="is-official=true" docker search ruby --filter="is-official=true"
-</code>  +</code> 
 +==== Use the first 4 letters of a container hash to reference it ==== 
 +<code bash> 
 +docker image inspect f4f4 
 +</code> 
 +You only need to reference the first 4 characters of the ID for it to work.
  
 ---- ----
Line 100: Line 106:
   }   }
  
-Then restart Docker and you’ll be good to go.+ 
 +This will keep 10Gb of log files, so adjust accordingly 
 + 
 +Then restart Docker with ''sudo systemctl restart docker.service'' and you’ll be good to go.
  
 ---- ----
-==== Use the first 4 letters of a container hash to reference it ==== 
-<code bash> 
-docker image inspect f4f4 
-</code> 
-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://nickjanetakis.com/blog/tag/docker-tips-tricks-and-tutorials https://nickjanetakis.com/blog/tag/docker-tips-tricks-and-tutorials
docker.1630137522.txt.gz · Last modified: 2021/08/28 10:58 by alexk7110