Not clear how to configure public registry with auth for upload

Bug #1808357 reported by Tom Haddon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Docker Registry Charm
Fix Released
Critical
Kevin W Monroe

Bug Description

We'd like to use this charm to configure a publicly available registry with authenticated upload for images.

It seems like if we configure basic auth, we can't then have non-authenticated users download images.

Changed in layer-docker-registry:
importance: Undecided → Critical
Changed in layer-docker-registry:
assignee: nobody → Kevin W Monroe (kwmonroe)
status: New → Triaged
Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

This will be challenging. I don't see a clean way for a single registry to provide both unauth'd pulls and auth'd pushes. Topics I've read lean towards 2 registries that share a storage backend with a proxy that allows pulls / blocks pushes for the unauth'd client and allows all requests for the auth'd client.

I'm working on a bundle that does just that. Hopefully this will satisfy this request.

Revision history for this message
Junien F (axino) wrote :

Perhaps we can do auth ourselves by fronting with, say, an apache2 that allows GETs for everyone but PUT/POST/DELETE for a restricted list of authenticated users ?

Revision history for this message
Mike Wilson (knobby) wrote :

It depends on how you want to auth users. I'm not sure you could do a `docker login` with that setup. It might be easier than running two docker registries and hoping that there isn't a collision with one guy downloading an image from the public side while another uploads that same image to other side. I'm pretty sure that would be undefined behavior.

Both ways have their downsides and Docker hasn't really solved this problem.

Revision history for this message
Tom Haddon (mthaddon) wrote :

We believe we can do this via running two registries with different frontend domains (e.g. have auth on upload.docker-images.canonical.com and the public registry on docker-images.canonical.com). We can just configure both to have the same swift credentials, and only allow auth on upload.docker-images.canonical.com as necessary, but make docker-images.canonical.com globally readable.

We may need a config option to say that a particular registry is read-only (I'm not sure what the permissions are without any auth configured), but otherwise this seeems feasible. I'll create a ticket to track the work to do this internally and we'll update this bug when we're done.

Revision history for this message
Dean Henrichsmeyer (dean) wrote : Re: [Bug 1808357] Re: Not clear how to configure public registry with auth for upload

I realize this is a bit of a bike shed but I don't think we should have
docker in the hostname. registry.* or something more generic would be more
appropriate. Thanks.

Revision history for this message
Junien F (axino) wrote :
Revision history for this message
Paul Collins (pjdc) wrote :

I've implemented this config item and updated the staging deployment.

PR: https://github.com/CanonicalLtd/docker-registry-charm/pull/22

Available from cs:~canonical-sysadmins/docker-registry which please
note is much newer than the versions currently published to any channel.

And, per RT#114764, I've used this to rearrange the staging deployment.

Revision history for this message
Paul Collins (pjdc) wrote :

I just noticed that #50 is published to edge, so my remark above is incorrect.

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

This is fixed in cs:~containers/docker-registry-56 (currently in the beta channel). The process for deploying public/private registries is now documented in the charm readme:

https://github.com/CanonicalLtd/docker-registry-charm/blob/master/README.md#read-only-mode

Changed in layer-docker-registry:
status: Triaged → Fix Committed
Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

This has made its way into the latest stable charm:

https://jujucharms.com/u/containers/docker-registry

Changed in layer-docker-registry:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.