Hacker News new | comments | ask | show | jobs | submit login
Show HN: Command Line Tool to push Docker images to a server over ssh (github.com)
10 points by bthornbury 5 months ago | hide | past | web | favorite | 3 comments

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...).

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

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.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact