Skip to content

Instantly share code, notes, and snippets.

@malefs
Forked from developerinlondon/docker.md
Created June 1, 2018 09:58
Show Gist options
  • Select an option

  • Save malefs/3e18285b5ab743924fd6de9eb4e81525 to your computer and use it in GitHub Desktop.

Select an option

Save malefs/3e18285b5ab743924fd6de9eb4e81525 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

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