Skip to content

Instantly share code, notes, and snippets.

@xcsrz
Created November 3, 2014 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xcsrz/4d76c8057ec860741314 to your computer and use it in GitHub Desktop.
Save xcsrz/4d76c8057ec860741314 to your computer and use it in GitHub Desktop.
Get a docker image from a remote host imported onto the localhost in the most direct way possible.
#!/bin/bash
#### either replace $USERNAME, $DOCKERHOST and $IMAGENAME in the command
#### or adjust and use the following export commands before running this as a script
# export USERNAME=xcsrz
# export DOCKERHOST=1.1.1.1
# export IMAGENAME=xcsrz/forth
ssh $USERNAME@$DOCKERHOST "sudo docker save $IMAGENAME | gzip -c" | gunzip -c | docker load
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment