問題:Your Docker build environment ran out of disk space.
# 檢查 docker 狀態
df -h
docker system df
# 清理docker 空間
# Remove all unused data
docker system prune -a --volumes
# Remove build cache
docker builder prune -a
# Check again
df -h
問題:變更docker 位置
# Stop Docker
sudo systemctl stop docker
# Edit Docker config
sudo nano /etc/docker/daemon.json
# add the following code in daemon.json
{
"data-root": "/new/docker/path"
}
# Create new directory
sudo mkdir -p /new/docker/path
# Move existing data (optional)
sudo rsync -aP /var/lib/docker/ /new/docker/path/
# Start Docker
sudo systemctl start docker