Skip to content

Instantly share code, notes, and snippets.

@0wnrepo
Forked from developerinlondon/docker.md
Created May 4, 2019 13:27
Show Gist options
  • Save 0wnrepo/37f81d62fb35bfe9e249ca06c6850092 to your computer and use it in GitHub Desktop.
Save 0wnrepo/37f81d62fb35bfe9e249ca06c6850092 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