Skip to content

Docker: how to save docker images

In some cases you want to save your local docker images, for example to back them up when they are no longer available from anywhere except that one machine still running it. Here's how to do it: 1. List the docker images or docker containers to get the name of the image: 1. sudo docker image ls 2. sudo docker ps 2. Copy the docker image to a file: 1. sudo docker save -o /tmp/gisops_valhalla_latest.tar gisops/valhalla:latest 3. Optionally copy the image file to your local machine for safe-keeping somewhere else: 1. gcloud compute scp attracs-core-backends-multi-zone-nng8:/tmp/gisops_valhalla_latest.tar ~/projects/work/backups/ --project attracs-services-195009 --zone europe-north1-b --tunnel-through-iap