Skip to content

Instantly share code, notes, and snippets.

@philipz
Last active May 18, 2023 09:18
Show Gist options
  • Save philipz/1a5f7cd50bfcb938619a to your computer and use it in GitHub Desktop.
Save philipz/1a5f7cd50bfcb938619a to your computer and use it in GitHub Desktop.
Docker image save/load by SSH

#Docker image save/load by SSH From Easily transfer docker images between two machines over the network

docker save busybox:latest | ssh -i ~/philipz/key.pem [email protected] 'docker load'

#Docker-machine First, use $(docker-machine env XXXXX) to get control env parameter. Then you can use docker access remote cloud machine.

docker save busybox:latest | ssh -i ~/.docker/machine/machines/azdocker2/id_rsa [email protected] sudo docker load

docker save busybox:latest | docker-machine ssh azdocker2 sudo docker load

docker save $IMAGE_REPOSITORY:$1 | bzip2 | pv | ssh $REMOTE_USERNAME@$REMOTE_HOST 'bunzip2 | docker load'

Deploying Docker images via SSH

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