
Show HN: Command Line Tool to push Docker images to a server over ssh - bthornbury
https://github.com/coherenceapi/docker-push-ssh
======
bthornbury
A little bit on how this tool works.

Usually you can easily push your local docker images by calling docker save,
scp the tar file, then docker load on the remote host. The downside here is
that you are pushing every layer of the entire image every time (maybe GBs).

An alternative is to set up your own private registry or use a public one like
dockerhub. This can be undesirable or cumbersome for a number of reasons,
especially for code you prefer to keep private.

So this tool essentially establishes a private registry on your host which is
only bound to localhost (no outside access), establishes an ssh tunnel from
your host to the remote to access that private registry, pushes only the
layers which don't yet exist on the host, and then cleans up after itself
(closing down the registry, ssh tunnel, etc...).

~~~
nhoughto
You could just ssh tunnel the docker host tcp port right? And then push
straight at it, intermediate registry is to reduce privileges?

~~~
bthornbury
As I understand it, push only goes to a registry. So even with an ssh tunnel
to the docker host tcp port, there's no obvious way to transport the image
from your localhost.

You should be able to "docker build" the image on the remote host that way.
Downside there is that you are transporting the entire build context rather
than just the layers. IMO most cases will be less efficient.

