by dbingham · 3y ago · 0 comments
In 30 days a bunch of images we depend on may just disappear. We mostly depend on images from relatively large organizations (`alpine`, `node`, `golang`, etc), so one would want to believe that we'll be fine - they're all either in the open source program or will pay. But I can't hang my hat on that. If those images disappear, we lose the ability to release and that's not acceptable.
There's no way for us to see which organizations have paid and which haven't. Which are members of the open source program and which aren't. I can't even tell which images are likely at risk.
The best I can come up with, at the moment, is waiting for each organization to make some sort of announcement with one of "We've paid, don't worry", "We're migrating, here's where", or "We've applied to the open source program". And if organizations don't do that... I mean, 30 days isn't enough time to find alternatives and migrate.
So we're just left basically hoping that nothing blows up in 30 days.
And companies that do that to me give me a very strong incentive to never use their products and tools if I can avoid it.
They are versioned and reviewed here: https://github.com/docker-library/official-images
I don't expect them to go away.
Disclosure: I maintain two of them (spiped, adminer).
But it seems to me that Docker official images are no more at risk of deletion today than they were a week ago.
I can't be certain I won't be hit by a car, or a storm won't rip up the fibre to my house, or a raft of other things, either.
If you are relying on images hosted by a third party, you have already committed to relying on something without certainty.
You can only plan ahead with uncertainty, because that's the only way that humans interact with time. Nothing is 100%. Even if you paid enterprise rates for the privilege to run a local instance, and ran that on a physical server on your site, and had backup hardware in case the production hardware failed...the stars might be misaligned and you might fail your build. You can only estimate probabilities, and you must therefore include that confidence level in your plans.
Sure, depending on free third-party sources is much more risky than any of that, but no one knows the future (at least for now, and ignoring some unreliable claims of some mystics to the contrary, though I estimate with very high confidence that those claims are false and that this state of affairs is unlikely to change in the next 5 years).
Still, shame on docker for the rug-pull.
Secondly, if this is a serious worry. I would recommend creating your own private docker registry.
https://docs.docker.com/registry/deploying/
Then I would download all current versions of the images you use within your org and push them up to said registry.
It’s not a perfect solution, but you’ll be able to pull the images if they disappear and considering this will take only a few minutes to set up somewhere, could be a life saver.
As well, I should note that most cloud providers also have a container registry service you can use instead of this. We use the google one to back up vital images to in case Docker Hub were to have issues.
Is this a massive pain in the butt? Yup! But it sure beats failed deploys! Good luck out there!
Edit: Damn, looks like ECR's pull through caching only works for ECR Public and Quay? It's a little unclear, but maybe not a drop in solution for Docker Hub replacement.
https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-...
I know people groan at running infrastructure, but the registry software is really well documented and flexible.
If you don't need to 'push', but only pull - configuring them as pull through caches is nice for availability and reliability -- while also saving from nickle/diming.
They will get things from a configurable upstream, proxy.remoteurl.
Contrary to what the documentation says, this can work with anything speaking the API. Not just Dockerhub.
edit: My one criticism, it's not good from an HTTPS hardening perspective. It's functional, but audits find non-issues.
You'll want nginx or something in front to ensure good HSTS header coverage for non-actionable requests, for example.
The situation just presented an opportunity for improvement, I don't intend to suggest it as a cure - but a good step!
Edit: For anyone curious, our upstream is actually the same software somewhere else, utilized by CICD.
That being the origin allows for pushes, with the pull-through caches being read-only by nature
Means, it's mostly a question of, (a) checking for image squatting on the hub after orgs get deleted, which I don't know how to deal with just yet (could I just null-route the docker hub on my registry until evaluated and we just don't get new images?), and (b) ruffling through all of our container systems to see where people use what image to figure out which are verified, or paying, or obsoleted, and where they went, or what is going on. That'll be great fun.
We run them in 'maintenance mode' just to be absolutely sure anything the upstream doesn't have (or had at one point) is permitted in!
Though, I don't think they'll allow pushes anyway with 'proxy.remoteurl' defined.
I'm not sure I followed your setup properly, but with the private registry defined as your 'proxy.remoteurl', you shouldn't have to worry about the Hub in particular - unless it's looking there, or people are pushing bad things into it
I've personally been using Sonatype Nexus for a few years with no issues - both for caching external images, as well as hosting my own custom ones. It has pretty good permissions management and cleanup policies.
Here's more info: https://blog.kronis.dev/tutorials/moving-from-gitlab-registr...
Edit: here's a link to the site of the product directly as well, in case anyone is interested in the self-hosted option: https://www.sonatype.com/products/nexus-repository
It's probably not for everyone, but only having to pay for the VPS (or host things on my homelab) feels both simpler and more cost effective in my case. I've also used it at work and there were very few issues across the years with it, mostly due to underestimating how much storage would be needed (e.g. going with 40 GB of storage for approx. 10 apps, each of which were in active development).
This shines light on why it is so risky (from both availability and security perspectives) to be dependent on any third party for the build pipeline of a product.
I have always insisted that all dependencies must be pulled from a local source even if the ultimate origin is upstream. I am continuously surprised how many groups simply rely on some third party service (or a dozen of them) to be always and perpetually available or their product build goes boom.
Slightly related: actually knowing for sure that you've got a handle on all of the external dependencies is sometimes harder than it should be. Building in an environment with no outbound network access turns up all sorts of terrible things - far more often than it should. The kind that worry me are supposedly self-contained packages that internally do a bunch of "curl | sudo bash" type processing in their pre/post-install scripts. Those are good to know about before it is too late.
Yes, highly recommended to build on such a system, it'll shake out the roaches that lie hidden.
In a small startup environment, the very least to do is at least keep a local repository of all external dependencies and build off that, so that if a third party goes offline or deletes what you needed you're still good.
For larger enterprises with more resources, best is to build everything from source code kept in local repositories and do those builds, as you say, in machines with no network connectivity. That way you are guaranteed that the every bit of code in your product can be (re)built from source even far in the future.
This is the tradeoff we made with the move to cloud. We run our workloads on AWS, GCP or Azure, use DataDog or New Relic for monitoring, use Github or GitLab for repos and pipelines, and so forth. Each speeds us up but is a risk. We hope they are relatively low risks and we work to ameliorate those risks as we can.
An organization like Docker should have been low risk. Clearly, it's not. So now it's a strong candidate for replacement with a local solution rather than a vendor to rely on.
If you can't easily use an existing caching solution, then the only NIH you need to do is copying files that your build system downloads. I know many build systems are "just a bunch of scripts" so those would probably be pretty amenable to this, I don't know if more opaque systems exist that wouldn't give you any access like that. If so, I suppose you could try to just copy the disk the build system writes everything to, but then you're getting into pretty hacky stuff and that's not ideal. Copying the files doesn't give you the nice UX of a cache, but it does mean that in the worst case scenario you at least have the all the dependencies you've used in recent builds, so you'll be able to keep building your things.
As long as there is there is "server reimplementation", i.e. private registries available, one can always hack together a solution out of self signed CA, DNS and routing to replace "the server" with local registry.
We moved to cloud as well, and we use AWS ECR for caching. We have a script for "docker login to ECR" and a list of images to auto-mirror periodically. There is a bit of friction when adding new, never-seen-before image, but in general this does not slow developers much. And we never hit any rate-limits, too!
We pay for those ECR accesses, so I am pretty confident they are not going to go away. Unlike free docker images.
It's a bit of a leap from keeping copies of dependencies to building your own datacenter. Even the smallest startup can easily do the former.
> This is the tradeoff we made with the move to cloud.
To clarify, when I say keep local copies I meant copies which are under local control (i.e. control of your organization). They may well still physically be in AWS somewhere. The key is that they can't be modified/deleted by some third party who doesn't report to your organization.
Yes, this assumes AWS is too big to fail, but for the typical startup whose entire existence is already dependent on their AWS account being available, this would not increase risk beyond what it already is. Whereas each additional hard dependency on third-party repos do increase risk.
The problem with this approach begins when many people your build depends upon start to share it.
Not to mention vertically integrating the entire Docker layer set defeats the whole point of using Docker in the first place.
What they're suggesting is basically setting up a cache for it locally in-between them and the "main repo" and ensuring the cache doesn't delete after x days and/or keep backups of the images they depend on.
If the package disappears, or the main repo falls over (cough github, cough), your devs, CI & prod aren't sat twiddling thumbs unable to work...
and if the package is nuked off the planet? You've got some time then to find an alternate / see where they move to.
I would expect the security and quality of images in a decentralized system to be far superior to any centralized system spun up by some for profit entity.
* malware and spyware could be defined here as software that allows remote keylogging, camera activation, installation of any executables, etc - i.e. root access - which is precisely what most corporate entities make software to do (e.g. "security solutions" that you have to install on your work computers). This is also most web services which are 90% tracking with an occasional desired application or feature these days.
Not doing that is unusual, and actually less secure. Do you think it's sane or secure for all of your builds to depend on downloading packages from the public internet?
If docker pushes people to that, hopefully more reproducible solutions like nix and it's ux friendly "porcelains" such as https://devenv.sh/ gain market share.
this doesn't really seem like an unreasonable suggestion.
just change your build process to pull from the source repository (almost always linked from the docker hub page) instead and eliminate one level of dependency from the chain. in an ideal world, docker hub would have been a more stable buffer inbetween the original source of the image and you, but as long as they are proving to be more of a liability than a source of stability, just cut them out.
left-pad moment once again.
> I mean, 30 days isn't enough time to find alternatives and migrate.
Maybe take control of mission critical dependencies and self-host?
Last few years prove that this option is a no-go - they just don't do such things ! Independence ? Self-sufficiency ? Security ? Local, fast access ? Obviousness ? No payment required ? Avoid at all costs !
Who are "they"?
It wasn't too long ago that it was standard practice to vendor your dependencies; that is, dump your dependencies into a vendor/ directory and keep that directory updated and backed up.
But now, you all think it's 100% acceptable to just throw your hands up if github is down, or a maven repository is down, or docker hub makes a policy change?
Every year that goes by it becomes clear that we are actually regressing as a profession.
Try as I might, I couldn't get him to understand the difference between "git" the tool and "Github" the website. He kept making me nervous because he'd slip up and use the two terms interchangeably. (We have sensitive data that shouldn't be uploaded to the cloud.)
He didn't seem to completely understand files/folders and the desktop metaphor. He didn't seem to understand the difference between personal devices and work devices.
The last straw for our boss to let him go was he turned in a project that used a free web service on the cloud to upload data and get back the rows sorted. (Refer back to what I said above about: sensitive data.)
It didn't appear he was being obstinate, it was a tech-cultural difference. "Radical semantic disconnect" as I've seen the term used in science fiction.
Who is this "all" you're talking to? Seems like most of the responses are suggesting vendoring too.
This is a thread under most updooted comment. Generally it is safe to assume that top comment more or less reflects general sentiment
Your job as an SRE is not to look at things and go "oh well, nothing we can do lol".
all of that seems pretty true, and frankly no one should support a company that does something like this. I get they need to figure out how to make money, but time has shown the worst way to do that is to screw over customers or potential customers.
I like the poster will never trust docker, and will never use their tooling or formats, pod-man all the way.
And this week it turns out that makes the now problematic spots a lot more greppable
Some people think it is a perfectly reasonable idea to set up defaults to always pull, point to latest version and not have local cache/mirror. Judging from the number of upvotes on OP, depending on third party remote without any SLA to be always available for production workloads seems to be the default.
That seems like an entirely relevant complaint for this forum but from your first reply, you’re acting like somehow it’s the greatest offense in the world that someone pointed this out.
This is like complaining that you have to put out a fire because rather than fixing the sparking cables you have been relying on your neighbor to put them out before the become noticeable and he only gave you a short notice that he'd be going on vacation.
Not saying this is good news, but in the Enterprise, you have to plan for shit like this.
Some of those charts will not have variables that let you override the docker images and tags, so some of those will not be usable without creating a new release.
This is one of the primary reasons to vendor your third party docker images into a docker registry that you control.
Vendor your helm charts if they are production critical. Vendor the docker images if they are production critical. Vendor the libraries if they are critical.
As an added bonus, you even help making a saner internet where you don't pull left-pad three billion times a month.
EDIT: I just confirmed that GPT-4 can write this program. Have fun!
for any "official" image you're pulling from docker hub, just prefix it with "public.ecr.aws/docker/library/" to pull from ecr instead
Are you sure this is what you mean? Escrow is a type of contactual arrangement, one type of which is agreeing with a commercial partner that you get a copy of their source-code if they go broke.
I feel like you mean vendoring.
You can tell which are members of the open source program if you go to their docker hub page and you'll see a banner "SPONSORED OSS"
Here is an example:
AWS is in a better position to offer long term coverage.
Official images are hugely important to Docker, now and going forward.
Mirror the important shit. No excuses, just do. Yes, it's work. I guarantee though, you'll be less exposed to externally created drama.
Making sure your org stays up to date though, that's on you.
Install Gitlab, clone these projects onto it, it will usually detect and build the container images. You may have to manually fire off builds for older tags/branches but it will work
Write a script to iterate the images and push them to your own registry. This will buy you time in the event anything does dissapear.
I'm kidding, of course, but IIRC pkgsrc (and alikes, such as APT) has a number of limitations, for example a very limited ability to have multiple versions of the same package installed, making it less than optimal replacement.
(I believe a lot of people depend on ability to spin up a new version while the old is running, then do the cutover and shut down the old one after it's not is use.)
If there were a comparable culling of the Nixpkgs binary cache, pipelines relying on Nix for their packages would be affected in a much less invasive way: they'd see Nix silently fall back to upstream sources, and reproducibly build from source, wherever the caches binary artifacts became unavailable.
...and crucial features, like having security fixes backported.
It’s your responsibility to ensure your own business continuity. You should review how your build pipeline depends on resources outside of your org perimeter, and deploy a private registry under your own control.
btw, you could also contribute some mirroring bandwidth to the community. You must’ve heard that the cloud is just someone else’s computer.