Docker - exporting & importing images
Export all images
docker save -o stack.tar $(docker images --format "{{.Repository}}:{{.Tag}}")
Export images from docker compose
docker save $(docker compose convert --images) | gzip > stack.tgz
Load the stack
docker load -i stack.tar
Some extra sysadmin tasks
Truncate the logs
sudo sh -c "truncate -s 0 /var/lib/docker/containers/**/*-json.log"
Kill all images - use at your peril.
docker images -a
docker rmi $(docker images | awk "NR>0 {print$3}")


Comments
Post a Comment