-
Notifications
You must be signed in to change notification settings - Fork 20
Docker
Márton Elekes edited this page Sep 23, 2020
·
50 revisions
- container
- image
- volume
-
Problem: neither DNS resolution, nor ping works
-
Solution: check the accepted answer at https://stackoverflow.com/a/23811974/3580502:
sudo vim /etc/NetworkManager/NetworkManager.conf # comment the "dns=dnsmasq" line sudo service network-manager restart
- Stop the service with
sudo service docker stop
- Create a file if it does not exist under
/etc/docker/daemon.json
. - Add the following content
{ "data-root": "/path/to/new/docker/data/dir" }
-
Prior to Docker 17,
graph
should be used instead ofdata-root
. - Copy the contents
sudo rsync -aP /var/lib/docker/ /path/to/your/docker-data
- Restart the service
sudo service docker start
The steps are from this article.
sudo gpasswd -a $USER docker
newgrp docker
The previous approach was to use sudo usermod -aG docker $USER
but it required a restart (even with newgrp
).
docker rmi -f $(docker images | grep "<none>" | awk '{print $3}')
docker exec -it $CONTAINER bash
echo $HOSTNAME
Detach from container without stopping it then attach to the same console
- Ctrl+P, Ctrl+Q
docker attach «CONTAINER ID»
docker save $(docker images -qa) | pv | zstd -10 -T0 -o docker.zst
zstdcat docker.zst | pv | docker load