distribution/distribution

feat: Support h2c protocol (HTTP2 over cleartext)

erezrokah opened this issue · 0 comments

Description

The docker registry supports HTTP2 by default, but only when using TLS.
It would be useful to support HTTP2 when not using TLS as well for the following use case:

When deploying the registry to GCP Cloud Run, one can't use TLS as Cloud Run expects the application to expose an unencrypted HTTP endpoint. Due to the lack of HTTP2 support for unencrypted HTTP requests, one can't set the end to end HTTP2 setting in Cloud Run (see https://cloud.google.com/run/docs/configuring/http2).

Since HTTP2 requests are downgraded to HTTP1 those will be bound to the request size limit of 32MB which means it's almost impossible to push any images. See limits in https://cloud.google.com/run/quotas

I believe it should be a ~1 line change mostly to wrap the HTTP handler with an HTTP2 (PR coming in a bit to demonstrate)