TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using S3 as a Container Registry

319 pointsby jandeboevrie10 months ago

24 comments

stabbles10 months ago
The OCI Distribution Spec is not great, it does not read like a specification that was carefully designed.<p>&gt; According to the specification, a layer push must happen sequentially: even if you upload the layer in chunks, each chunk needs to finish uploading before you can move on to the next one.<p>As far as I&#x27;ve tested with DockerHub and GHCR, chunked upload is broken anyways, and clients upload each blob&#x2F;layer as a whole. The spec also promotes `Content-Range` value formats that do not match the RFC7233 format.<p>(That said, there&#x27;s parallelism on the level of blobs, just not per blob)<p>Another gripe of mine is that they missed the opportunity to standardize pagination of listing tags, because they accidentally deleted some text from the standard [1]. Now different registries roll their own.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;opencontainers&#x2F;distribution-spec&#x2F;issues&#x2F;461#issuecomment-1701554264">https:&#x2F;&#x2F;github.com&#x2F;opencontainers&#x2F;distribution-spec&#x2F;issues&#x2F;4...</a>
评论 #40944388 未加载
评论 #40944033 未加载
kbumsik10 months ago
Actually, Cloudflare open-sourced a container registry server using R2.[1]<p>Anyone tried it?<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;cloudflare&#x2F;serverless-registry">https:&#x2F;&#x2F;github.com&#x2F;cloudflare&#x2F;serverless-registry</a>
评论 #40946265 未加载
wofo10 months ago
Hi HN, author here. If anyone knows why layer pushes need to be sequential in the OCI specification, please tell! Is it merely a historical accident, or is there some hidden rationale behind it?<p>Edit: to clarify, I&#x27;m talking about sequentially pushing a _single_ layer&#x27;s contents. You can, of course, push multiple layers in parallel.
评论 #40947175 未加载
评论 #40943523 未加载
评论 #40975672 未加载
评论 #40947143 未加载
评论 #40943762 未加载
评论 #40944062 未加载
KronisLV10 months ago
That&#x27;s a pretty cool use case!<p>Personally, I just use Nexus because it works well enough (and supports everything from OCI images to apt packages and stuff like a custom Maven, NuGet, npm repo etc.), however the configuration and resource usage both are a bit annoying, especially when it comes to cleanup policies: <a href="https:&#x2F;&#x2F;www.sonatype.com&#x2F;products&#x2F;sonatype-nexus-repository" rel="nofollow">https:&#x2F;&#x2F;www.sonatype.com&#x2F;products&#x2F;sonatype-nexus-repository</a><p>That said:<p>&gt; More specifically, I logged the requests issued by docker pull and saw that they are “just” a bunch of HEAD and GET requests.<p>this is immensely nice and I wish more tech out there made common sense decisions like this, just using what has worked for a long time and not overcomplicating.<p>I am a bit surprised that there aren&#x27;t more simple container repositories out there (especially with auth and cleanup support), since Nexus and Harbor are both a bit complex in practice.
评论 #40955262 未加载
akeck10 months ago
Note that CNCF&#x27;s Distribution (formerly Docker&#x27;s Registry) includes support for backing a registry with Cloudfront signed URLs that pull from S3. [1]<p><a href="https:&#x2F;&#x2F;distribution.github.io&#x2F;distribution&#x2F;storage-drivers&#x2F;middleware&#x2F;" rel="nofollow">https:&#x2F;&#x2F;distribution.github.io&#x2F;distribution&#x2F;storage-drivers&#x2F;...</a>
rad_gruchalski10 months ago
What’s wrong with <a href="https:&#x2F;&#x2F;github.com&#x2F;distribution&#x2F;distribution">https:&#x2F;&#x2F;github.com&#x2F;distribution&#x2F;distribution</a>?
评论 #40944245 未加载
lofties10 months ago
This sounds very, very expensive, and I would&#x27;ve loved to see cost mentioned in the article too. (for both S3 and R2)
评论 #40951214 未加载
评论 #40945591 未加载
donatj10 months ago
I don&#x27;t do a ton with Docker outside dev tooling, but I have never understood why private container registries even exist? It just smells like rent seeking. What real advantage does it provide over say just generating some sort of image file you manage yourself, as you please?
评论 #40944618 未加载
评论 #40944614 未加载
评论 #40947404 未加载
评论 #40944709 未加载
评论 #40945616 未加载
评论 #40947107 未加载
评论 #40944653 未加载
watermelon010 months ago
It seems that ECR is actually designed in a way to support uploading image layers in multiple parts.<p>Related ECR APIs:<p>- InitiateLayerUpload API: called at the beginning of upload of each image layer<p>- UploadLayerPart API: called for each layer chunk (up to 20 MB)<p>- PutImage API: called after layers are uploaded, to push image manifest, containing references to all image layers<p>The only weird thing seems to be that you have to upload layer chunks in base64 encoding, which increases data for ~33%.
评论 #40966211 未加载
phillebaba10 months ago
Interesting idea to use the file path layout as a way to control the endpoints.<p>I do wonder though how you would deal with the Docker-Content-Digest header. While not required it is suggested that responses should include it as many clients expect it and will reject layers without the header.<p>Another thing to consider is that you will miss out on some feature from the OCI 1.1 spec like the referrers API as that would be a bit tricky to implement.
8organicbits10 months ago
&gt; that S3 is up to 8x faster than ECR<p>Awesome. Developer experience is so much better when CI doesn&#x27;t take ages. Every little bit counts.
评论 #40946873 未加载
cpa10 months ago
Is there a good reason for not allowing parallel uploads in the spec?
评论 #40943574 未加载
评论 #40943575 未加载
michaelmior10 months ago
&gt; Why can’t ECR support this kind of parallel uploads? The “problem” is that it implements the OCI Distribution Spec…<p>I don&#x27;t see any reason why ECR couldn&#x27;t support parallel uploads as an optimization. Provide an alternative to `docker push` for those who care about speed that doesn&#x27;t conform to the spec.
评论 #40945563 未加载
champtar10 months ago
What I would really love is for the OCI Distribution spec to support just static files, so we can use dumb http servers directly, or even file:&#x2F;&#x2F; (for pull). All the metadata could be&#x2F;is already in the manifests, having Content-Type: octet-stream could work just fine.
victorbjorklund10 months ago
But this only works for public repos right? I assume docker pull wont use a s3 api key
评论 #40944477 未加载
kevin_nisbet10 months ago
It&#x27;s cool to see it, I was interested in trying something similar a couple years ago but priorities changed.<p>My interest was mainly around a hardening stand point. The base idea was the release system through IAM permissions would be the only system with any write access to the underlying S3 bucket. All the public &#x2F; internet facing components could then be limited to read only access as part of the hardening.<p>This would of course be in addition to signing the images, but I don&#x27;t think many of the customers at the time knew anything about or configured any of the signature verification mechanisms.
tealpod10 months ago
This is such a wonderful idea, congrats.<p>There is a real usecase for this in some high security sectors. I can&#x27;t put complete info here for the security reasons, let me know if you are interested.
lazy_moderator110 months ago
That&#x27;s neat! On that note I&#x27;ve been using S3 as a private registry for years now via Gitlab and couldn&#x27;t be happier!
jaimehrubiks10 months ago
I experience everyday the slowness of pushing big images (ai related tend to be big) to ECR on our cicd.
评论 #40943642 未加载
dheera10 months ago
Make sure you use HTTPS, or someone could theoretically inject malicious code into your container. If you want to use your own domain you&#x27;ll have to use CloudFront to wrap S3 though.
评论 #40966218 未加载
ericfrederich10 months ago
R2 in only &quot;free&quot; until it isn&#x27;t. Cloudflare hasn&#x27;t got a lot of good press recently. Not something I&#x27;d wanna build my business around.
评论 #40945490 未加载
评论 #40945202 未加载
fnord7710 months ago
&gt; What makes S3 faster than ECR?<p>the author is missing something huge - ECR does a security scan on upload, too.
ericpauley10 months ago
Where&#x27;s the source code?
评论 #40944450 未加载
评论 #40945313 未加载
filleokus10 months ago
I&#x27;ve started to grow annoyed with container registry cloud products. Always surprisingly cumbersome to auto-delete old tags, deal with ACL or limit the networking.<p>It would be nice if a Kubernetes distro took a page out of the &quot;serverless&quot; playbook and just embedded a registry. Or maybe I should just use GHCR
评论 #40945889 未加载
评论 #40948765 未加载
评论 #40951246 未加载
评论 #40945312 未加载
评论 #40946988 未加载