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

Popular posts from this blog

Handling and Tyre wear patterns

Getting FlashFloppy onto the Gotek SFRC922D