User Tools

Site Tools


linux: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
linux:docker [2023/08/01 23:16] – [Health Checks] Wulf Rajeklinux:docker [2025/04/16 23:45] (current) Wulf Rajek
Line 2: Line 2:
  
 https://docs.docker.com/storage/volumes/ https://docs.docker.com/storage/volumes/
 +
 +===== Main install =====
 +<code>
 +apt-get -y install curl unzip dialog
 +curl -fSSL get.docker.com | sh
 +</code>
 +
 +===== Show logs =====
 +
 +<code>
 +docker logs --follow <containername>
 +</code>
 +
 +
 +===== Build image =====
 +
 +To build the docker image based on a Dockerfile in the current directory, use:
 +<code>
 +docker build .
 +</code>
  
 ===== Update container ===== ===== Update container =====
Line 96: Line 116:
 docker tag current/image:tag new/image:tag docker tag current/image:tag new/image:tag
 </code> </code>
 +
 +===== cmd shell of container =====
 +<code>
 +docker exec -it <mycontainer> bash
 +docker exec -it <mycontainer> /bin/sh
 +</code>
 +
 +===== GPU hardware acceleration =====
 +
 +Make sure the relevant GPU drivers are installed on the base system, then pass through the device via docker compose.
 +Check devices are available, there should be a device per GPU starting at renderD128 for the first GPU:
 +<code>
 +ls -la /dev/dri
 +</code>
 +
 +<code>
 +  devices:
 +   - /dev/dri:/dev/dri
 +</code>
 +
 +===== docker ps short =====
 +Short form of docker ps to only get the container names:
 +<code>
 +docker ps | sed 's/   */#/g' | cut -d "#" -f 7
 +</code>
 +
 +===== docker running out of network addresses =====
 +
 +Error response from daemon: all predefined address pools have been fully subnetted 
 +
 +<code json /etc/docker/daemon.json>
 +{
 +"default-address-pools":[
 +    {"base":"169.254.2.0/23","size":28},
 +    {"base":"169.254.4.0/22","size":28},
 +    {"base":"169.254.8.0/21","size":28},
 +    {"base":"169.254.16.0/20","size":28},
 +    {"base":"169.254.32.0/19","size":28},
 +    {"base":"169.254.64.0/18","size":28},
 +    {"base":"169.254.128.0/18","size":28},
 +    {"base":"169.254.192.0/19","size":28},
 +    {"base":"169.254.224.0/20","size":28},
 +    {"base":"169.254.240.0/21","size":28},
 +    {"base":"169.254.248.0/22","size":28}
 +  ]
 +}
 +</code>
 +<code>
 +docker restart
 +docker network prune
 +</code>
 +
linux/docker.1690928191.txt.gz · Last modified: 2023/08/01 23:16 by Wulf Rajek