Skip to content

Instantly share code, notes, and snippets.

@developerinlondon
Last active January 9, 2024 11:31
Show Gist options
  • Save developerinlondon/8a9dc6060f933c724fc6 to your computer and use it in GitHub Desktop.
Save developerinlondon/8a9dc6060f933c724fc6 to your computer and use it in GitHub Desktop.
Docker saving and loading images

Here's how to save and load docker images:

Example scenario: To save a docker image from a docker repository and save it as a tar file locally.

  1. Save the image as a tarball

docker save repositoryname:tag > repotag.tar

  1. Zip the image

gzip repotag.tar

  1. Copy the tarball to the new machine.

scp repotag.tar.gz <foreign machine>

  1. Unzip The tarball

gunzip repotag.tar.gz

  1. Load the docker image

docker load < repotar.tar

  1. Find the Image ID

docker images

  1. Tag the image

docker tag repositoryname:tag

@hedza06
Copy link

hedza06 commented Sep 12, 2018

Great!

@robopageX
Copy link

thanks!

@Vijaypunugubati
Copy link

Thanks

@xyzkpz
Copy link

xyzkpz commented Sep 5, 2021

Thanks...!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment