Live data from Hacker News

Show HN: Unregistry – “docker push” directly to servers without a registry

github.com

51–60 of 178 posts

Re: Show HN: Unregistry – “docker push” directly to servers without a registry

#51
Very nice! I used to run a private registry on the same server to achieve this - then I moved to building the image on the server itself.

Both approaches are inferior to yours because of the load on the server (one way or another).

Personally, I feel like we need to go one step further and just build locally, merge all layers, ship a tar of the entire (micro) distro + app and run it with lxc. Get rid of docker entirely.

The size of my images are tiny, the extra complexity is unwarranted.

Then of course I'm not a 1000 people company with 1GB docker images.

Re: Show HN: Unregistry – “docker push” directly to servers without a registry

#52

It's very silly that Docker didn't work this way to start with. Thank you, it looks cool!

You can already achieve the same thing by making your image into an archive, pushing it to your server, and then running it from the archive on your server. Saving as archive looks like this: `docker save -o may-app.tar my-app:latest` And loading it looks like this: `docker load -i /path/to/my-app.tar` Using a tool like ansible, you can achieve easily what "Unregistry" is doing automatically. According to the github…

If you have an image with 100MB worth of bottom layers, and only change the tiny top layer, the unregistry will only send the top layer, while save / load would send the whole 100MB+.

Hence the value.

Re: Show HN: Unregistry – “docker push” directly to servers without a registry

#53

This is a cool idea that seems like it would integrate well with systems already using push deploy tooling like Ansible. It also seems like it would work as a good hotfix deployment mechanism at companies where the Docker registry doesn't have 24/7 support. Does it integrate cleanly with OCI tooling like buildah etc, or if you need to have a full-blown Docker install on both ends? I haven't dug deeply into this yet b…

You need a containerd on the remote end (Docker and Kubernetes use containerd) and anything that speaks registry API (OCI Distribution spec: https://github.com/opencontainers/distribution-spec) on the client. Unregistry reuses the official Docker registry code for the API layer so it looks and feels like https://hub.docker.com/_/registry

You can use skopeo, crane, regclient, BuildKit, anything that speaks OCI-registry on the client. Although you will need to manually run unregistry on the remote host to use them. 'docker pussh' command just automates the workflow using the local Docker.

Just check it out, it's a bash script: https://github.com/psviderski/unregistry/blob/main/docker-pu...

You can hack your own way pretty easily.

Re: Show HN: Unregistry – “docker push” directly to servers without a registry

#56
post #10

Nice. And the `pussh` command definitely deserves the distinction of one of the most elegant puns: easy to remember, self-explanatory, and just one letter away from its sister standard command.

It's fine, but it wouldn't hurt to have a more formal alias like `docker push-over-ssh`. EDIT: why I think it's important because on automations that are developed collaboratively, "pussh" could be seen as a typo by someone unfamiliar with the feature and cause unnecessary confusion, whereas "push-over-ssh" is clearly deliberate. Think of them maybe as short-hand/full flags.

That's a valid concern. You can very easily give it whatever name you like. Docker looks for `docker-COMAND` executables in ~/.docker/cli-plugins directory making COMMAND a `docker` subcommand.

Rename the file to whatever you like, e.g. to get `docker pushoverssh`:

  mv ~/.docker/cli-plugins/docker-pussh ~/.docker/cli-plugins/docker-pushoverssh
Note that Docker doesn't allow dashes in plugin commands.

Re: Show HN: Unregistry – “docker push” directly to servers without a registry

#57

Neat idea. This probably has the disadvantage of coupling deployment to a service. For example how do you scale up or red/green (you'd need the thing that does this to be aware of the push). Edit: that thing exists it is uncloud. Just found out! That said it's a tradeoff. If you are small, have one Hetzner VM and are happy with simplicity (and don't mind building images locally) it is great.

For sure, it's always a tradeoff and it's great to have options so you can choose the best tool for every job.

Re: Show HN: Unregistry – “docker push” directly to servers without a registry

#59
post #15

Ooh this made me discover uncloud. Sounds like exactly what I was looking for. I wanted something like dokku but beefier for a sideproject server setup.

I'm glad the idea of uncloud resonated with you. Feel free to join our Discord if you have questions or need help
Post reply on HN