Docker image push over SSH (distributed)

前端 未结 3 1486
礼貌的吻别
礼貌的吻别 2021-01-30 09:17

TL;DR Basically, I am looking for this:

docker push myimage ssh://myvps01.vpsprovider.net/

I am failing to grasp the rationale

3条回答
  •  逝去的感伤
    2021-01-30 09:27

    I made a command line utility just for this scenario.

    It sets up a temporary private docker registry on the server, establishes an SSH Tunnel from your localhost, pushes your image, then cleans up after itself.

    The benefit of this approach over docker save is that only the new layers are pushed to the server, resulting in a quicker upload.

    Oftentimes using an intermediate registry like dockerhub is undesirable, and cumbersome.

    https://github.com/brthor/docker-push-ssh

    Install:

    pip install docker-push-ssh

    Example:

    docker-push-ssh -i ~/my_ssh_key username@myserver.com my-docker-image

    Biggest caveat is that you have to manually add your local ip to docker's insecure_registries config.

    https://stackoverflow.com/questions/32808215/where-to-set-the-insecure-registry-flag-on-mac-os

提交回复
热议问题