News for hackers. Stuff that matters.
Re:MinIO passes 1B cumulative Docker Pulls by tpmx on Wednesday September 21, 2022 @03:47PM (#32930549)
I wonder what Docker's peak bandwidth usage is, and how they make it work, financially.

Just imagine the vast number of poorly cached CI jobs pulling gigabytes from Docker hub on every commit, coupled with naive aproaches to CI/CD when doing microservices, prod/dev/test deployments, etc.

Re:MinIO passes 1B cumulative Docker Pulls by treesknees on Wednesday September 21, 2022 @04:26PM (#32931044)
It's been 2 years now but Docker has started cracking down on this [1]. They introduced pull limits for anonymous and free accounts. Our company actually hit the anonymous limit regularly (several separate teams using docker/CI with the same public IP from our datacenter.) We've since started caching our images locally using Sonatype Nexus Repository Manager plus hosting our own registry for some simple things we used to be pulling from Docker Hub.

As far as financially, Docker now charges for enterprise use of Docker Desktop, which we've also started paying for. But I'm sure the bandwidth for running Docker Hub isn't cheap.

[1] https://docs.docker.com/docker-hub/download-rate-limit/

Re:MinIO passes 1B cumulative Docker Pulls by 5d8767c68926 on Wednesday September 21, 2022 @06:58PM (#32932713)
I have thought there needs to be much more trivial plug-and-play caching solution that works for the major services: npm, pypi, cargo, docker, etc. Right now, is is justifiably annoying enough that nobody worries about it until they are squandering terabytes of bandwidth or dealt with an external outage.
Re:MinIO passes 1B cumulative Docker Pulls by XorNot on Wednesday September 21, 2022 @08:42PM (#32933505)
It's called HTTP. The problem with all these services is they're using HTTPS for encryption and verification.

Which breaks all normal caching proxies that can be easily used.

The popular packaging formats are better at this: distribute keys over https, then just http to download and verify packages. Squid and co work just fine here.

Re:MinIO passes 1B cumulative Docker Pulls by Gigachad on Wednesday September 21, 2022 @08:54PM (#32933592)
No one will bother putting in the effort until usage quotas and costs get involved. While repos allow unlimited free pulls, it makes no sense for users to spend a minute caching anything.

Once quotas come in, you’ll find all the tooling and guides make it super simple.

Re:MinIO passes 1B cumulative Docker Pulls by KronisLV on Thursday September 22, 2022 @03:05AM (#32935606)
> No one will bother putting in the effort until usage quotas and costs get involved. While repos allow unlimited free pulls, it makes no sense for users to spend a minute caching anything.

I don't know about that. One of the benefits of introducing something like Nexus can be a noticeable speedup for your own builds, once your proxy repositories have the versions of dependencies you need cached.

Of course, you could use some sort of a local build cache (e.g. m2 directory for Maven packages on the server) but when you're building your own containers it doesn't always turn out to be as viable, especially when you have many CI nodes, each of which would have a local build cache.

On an unrelated note, something like Nexus also gives you the ability to easily start deploying/using your own container images, libraries or even arbitrary files, all without having to store your data in the cloud, or figure out how many different solutions/accounts you might need (otherwise you'd need some packages on Docker Hub, some Node packages on npm, some Java packages in Maven repos etc.).

Re:MinIO passes 1B cumulative Docker Pulls by raffraffraff on Thursday September 22, 2022 @04:03AM (#32936025)
There are very unsexy ways to reduce pull behaviour. In a previous life I built a CI/CD pipeline for an AI company and some of the container images were huge (ie GBs) so I did a lot of work on image caching. Mainly breaking up large containers into layers, starting with large layers with longer shelf-life, and incrementally adding faster-changing or smaller layers on top. Any time a large layer changed, it would trigger a packer rebuild for the CI runner AMI. The AMI also contained a start-up service that discovered and refreshed base images at boot time so they would (hopefully) never delay a real CI job. The natural scale up/down and max lifetime of the runner pool guaranteed that we never had an old AMI in use. It's likely that most people wouldn't bother with that level of optimization (or even host their own runners) but we need it.
Re:MinIO passes 1B cumulative Docker Pulls by orthoxerox on Thursday September 22, 2022 @07:09AM (#32937286)
Artifactory and Nexus work great for that.
Re:MinIO passes 1B cumulative Docker Pulls by teeray on Wednesday September 21, 2022 @10:17PM (#32934125)
It would be lovely to see Bittorrent in this space. Distributing an identical blob to N machines is squarely within its wheelhouse. All those CI machines would make wonderful seeders too.
Re:MinIO passes 1B cumulative Docker Pulls by danmcs on Thursday September 22, 2022 @12:18AM (#32934743)
Uber Engineering open-sourced Kraken [1], their peer-to-peer docker registry. I remember it originally using the BitTorrent protocol but in their readme they now say it is "based on BitTorrent" due to different tradeoffs they needed to make.

As far as I know there aren't any projects doing peer-to-peer distribution of container images to servers, probably because it's useful to be able to use a stock docker daemon on your server. The Kraken page references Dragonfly [2] but I haven't grokked it yet, it might be that.

It has seemed strange to me that the docker daemon I run on a host is not also a registry, if I want to enable that feature.

It's also possible that in practice you'd want your CI nodes optimized for compute because they're doing a lot of work, your registry hosts for bandwidth, and your servers again for compute, and having one daemon to rule them all seems elegant but is actually overgeneralized, and specialization is better.

1 https://github.com/uber/kraken

2 https://d7y.io/

Re:MinIO passes 1B cumulative Docker Pulls by scary-size on Thursday September 22, 2022 @02:27AM (#32935391)
The gaming industry has been using peer to peer downloads for a long time AFAIK. Unsure if they still do, pretty sure the Battle.net client did it.
Re:MinIO passes 1B cumulative Docker Pulls by smileybarry on Thursday September 22, 2022 @05:49AM (#32936720)
It was used in the WoW downloader pre-Battle.NET, they've moved off that and switched to CDNs (mostly Akamai IIRC) & dynamic patching, i.e.: Battle.NET computes differences and gets a diff.

Steam never used P2P downloading but they've had deals with ISPs and communities really early and made their own "CDN" full of caching servers everywhere, so if you waited a few hours to update, it might make it to your local server in time. Now I think they're on Akamai as well.

Re:MinIO passes 1B cumulative Docker Pulls by scary-size on Thursday September 22, 2022 @06:00AM (#32936800)
Oh, right, there was the WoW launcher before battle.net. I think I have another game in mind which used this, but I can’t really remember. Would love to get more insights on the economics of this (p2p vs. cdn).
Re:MinIO passes 1B cumulative Docker Pulls by smileybarry on Friday September 23, 2022 @01:48PM (#32955039)
WoW popularized it and a lot of “WoW killer” MMOs had P2P, but I never saw it “work” to be honest.
Re:MinIO passes 1B cumulative Docker Pulls by agumonkey on Wednesday September 21, 2022 @07:44PM (#32933122)
True, we have a few big inefficiences (on a local registry but still) that we didn't fix yet because no proper solution or higher priority tickets.. so CI just triggers loads of wasteful rebuilds.
Re:MinIO passes 1B cumulative Docker Pulls by goodpoint on Wednesday September 21, 2022 @07:19PM (#32932917)
...not to mention its environmental impact.

Docker requires to pull a 1GB image to run a 1MB binary.

Increases of 100x to 1000x are pretty common and moving data around is quite harmful.

Re:MinIO passes 1B cumulative Docker Pulls by alphabettsy on Wednesday September 21, 2022 @11:25PM (#32934478)
Docker doesn’t require that. Many images are just poorly built.
Re:MinIO passes 1B cumulative Docker Pulls by goodpoint on Thursday September 22, 2022 @06:01AM (#32936814)
Show me fully functional docker images that are 2MB in size...
Re:MinIO passes 1B cumulative Docker Pulls by alphabettsy on Saturday September 24, 2022 @12:38PM (#32964260)
There’s a huge gulf between 1GB and 2MB while still enjoying the benefits of containers. Go containers I build are <15MB and most of that is the fat Go binary.
Re:MinIO passes 1B cumulative Docker Pulls by kubanczyk on Thursday September 22, 2022 @04:43PM (#32944391)
Just slightly over 2MB nowadays:

  gcr.io/distroless/static-debian11   latest    10d0cc57bead   2.36MB
No functionality beyond running a binary, but, hey, that's what GP wanted.
Re:MinIO passes 1B cumulative Docker Pulls by goodpoint on Friday September 23, 2022 @03:56AM (#32949169)
And yet I clearly wrote "fully functional"...
Re:MinIO passes 1B cumulative Docker Pulls by prmoustache on Thursday September 22, 2022 @06:13AM (#32936889)
I only use distro and scratch base image and build my own images locally from dockerfiles.
Re:MinIO passes 1B cumulative Docker Pulls by KronisLV on Thursday September 22, 2022 @03:15AM (#32935668)
> Just imagine the vast number of poorly cached CI jobs pulling gigabytes from Docker hub on every commit, coupled with naive aproaches to CI/CD when doing microservices, prod/dev/test deployments, etc.

I hit the rate limits that others talk of in the comments, which motivated me to use Nexus for both proxying and storing my own container images. I actually tried using GitLab Registry before, but something with a bit more flexibility (cleanup policies) is nice! So far, it's been pretty good, I actually wrote about the process on my blog, "Moving from GitLab Registry to Sonatype Nexus": https://blog.kronis.dev/tutorials/moving-from-gitlab-registr...

Another thing that I tried, however, was to only rely upon Docker Hub for the base images that I want (Ubuntu in my case) and then build everything I need on top of that, doing things like installing Java/Node/Python/Ruby/... manually, adding utilities I want across all of the images etc. Once again, I wrote about it on my blog, "Using Ubuntu as the base for all of my containers": https://blog.kronis.dev/articles/using-ubuntu-as-the-base-fo...

That approach is absolutely more work, but also is something that's underexplored and works really nicely for me. Now I mostly rely on the OS package manager repositories (or mirrors of those), put less load on Docker Hub, don't risk running into its rate limits and also have common base layers across most of the images that I build, which in practice means less data actually needing to be downloaded to any of the servers where I want to utilize my images.

Of course, the downside is that getting something like PHP running was an absolute pain (tried with Apache, didn't work for some reason, then moved over to Nginx), and I technically miss out on some of the more complex space optimizations because if you look at the Dockerfiles for some of the more popular images, like OpenJDK, you'll occasionally see some interesting approaches, like getting the software package as a bunch of files and "installing" them directly, as opposed to using something like apt/yum: https://github.com/adoptium/containers/blob/08dd7d416cee0fe0...

Then again, personally I'd much prefer to rely on packages that I can get from something like apt directly, even if some of those versions can be a bit older (or add the project's official apt repositories as needed). One exception for software I don't install myself: databases, due to how good the majority of images out there (e.g. MySQL/PostgreSQL) are already. I just proxy/re-host those with different tags as needed.

Re:MinIO passes 1B cumulative Docker Pulls by pepemon on Wednesday September 21, 2022 @06:36PM (#32932493)
Please clarify what is "poorly cached" and what is your solution to be not so poorly cached in this context. Looks like you're overestimating blindly.
Re:MinIO passes 1B cumulative Docker Pulls by yjftsjthsd-h on Wednesday September 21, 2022 @06:55PM (#32932691)
If you run two jobs right after each other and the machine tries to pull the image separately for each one and redownloads the whole thing, then that's a poor cache. Modern practices make this relatively easy to accomplish by accident.
Re:MinIO passes 1B cumulative Docker Pulls by stingraycharles on Thursday September 22, 2022 @01:08AM (#32934992)
Especially for Docker, which is typically a daemon that runs in a different execution context as the CI job, which means you cannot just tell the CI job to cache some directory. Podman makes this easier but isn’t used as widely as Docker is.
Re:MinIO passes 1B cumulative Docker Pulls by mh- on Wednesday September 21, 2022 @06:54PM (#32932678)
a sibling comment to yours[0], from 'treesknees, addresses what a decent caching setup for this looks like.

> We've since started caching our images locally using Sonatype Nexus Repository Manager plus hosting our own registry for some simple things we used to be pulling from Docker Hub.

[0]: https://news.ycombinator.com/item?id=32931044