docker stop `docker ps -a -q`
docker rm `docker ps -a -q`
docker rmi -f `sudo docker images -q`
docker volume rm $(docker volume ls -f dangling=true -q)
docker images --no-trunc | grep none | awk '{print $3}' | xargs docker rmi -f
btrfs subvolume create /mnt/disk/@docker
rsync -aqxP /var/lib/docker/* /mnt/disk/@docker
- method 1:
變更 docker 儲存路徑
sudo vi /etc/docker/daemon.json
{
"registry-mirrors":["https://cache-docker.hopebaytech.com"],
"insecure-registries":["docker:5000"],
"dns":["172.16.1.254", "8.8.8.8"],
"graph": "/mnt/disk/docker",
"storage-driver": "btrfs"
}
重新啟動服務
sudo systemctl stop docker
sudo systemctl daemon-reload
sudo systemctl start docker
/etc/docker/daemon.json
/etc/default/docker
/etc/systemd/system/docker.service.d/docker.conf
# list containers
docker ps -a
# attach a running containers
docker attach [CONTAINER ID]
# attach a running containers into bash
docker exec -i -t arkease-pro-web bash