Support custom HTTP headers on `docker pull` / `docker push` (parity with ORAS and git)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, go
- Ambito
- cli, networking
Direzione di ricerca
Inizia tracciando i punti di ingresso dei comandi docker pull e docker push fino alle richieste al registry del daemon, quindi confronta come ORAS e git gestiscono gli header ripetibili. Il lavoro è completato quando entrambi i comandi accettano più volte -H/--header, passano questi header alle richieste al registry, mantengono il comportamento attuale senza il flag e definiscono la gestione degli header riservati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Summary
Add a repeatable --header / -H "Key: Value" flag to docker pull and docker push that attaches user-supplied HTTP headers to the registry requests the daemon makes. This brings the docker CLI to parity with tooling that already supports it (ORAS, git).
Motivation
Today the only header a client can influence on a pull/push is the credential from docker login (Basic or Bearer). That is not enough for a growing set of real setups:
- Parity with ORAS.
oras pull,oras push, andoras cpalready support--header, and it is widely used for custom registry and gateway integrations. Users who need a header today are pushed off the docker CLI onto ORAS or bespoke clients, losing docker daemon integration. - Custom auth proxies / gateways. Registries fronted by a proxy that expects a header other than Basic/Bearer — an API-key header, a signed token, a tenant or region selector — cannot be used with plain
docker pull.docker logincan only express the standard credential. - Header-based routing / multi-tenancy. A gateway that routes or scopes based on a custom header (e.g.
X-Tenant) has no way to receive it from docker. - Observability in CI. Passing correlation/trace headers (
X-Request-ID,traceparent) through pulls to debug slow or failing registry paths. - Experimenting with registry extensions. Custom registries trying out new capabilities need a header channel without asking every user to fork the CLI.
Prior art
This is well precedented:
- ORAS
--header/-H(same ecosystem, OCI registries). - git
http.extraHeader(git -c http.extraHeader="Key: Value" clone …) — added for exactly these proxy/auth scenarios. - curl
-H.
Proposed UX
docker pull -H "X-Example: value" [-H "X-Other: value"] registry/name:tag
docker push -H "X-Example: value" registry/name:tag
Repeatable; headers applied to the registry requests for that command. Reserved headers (e.g. Authorization, Host) could be rejected or gated to avoid surprising interactions with existing auth.
Alternatives considered
- Credential helpers — only cover authentication, not arbitrary headers.
- ORAS — works, but does not load images into the docker daemon.
- Forking the CLI — impractical for end users.
Compatibility
Fully opt-in and backward compatible: no --header means no change
- Lingua principale
- Go
- Stelle
- 6.1k
- Fork
- 2.2k
- Merge medio
- 1g 10h
- PR unite (30g)
- 47
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di docker/cli
-
kind/bug status/0-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
kind/bug status/0-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
kind/feature status/0-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
kind/bug status/0-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Issue simili
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
🤔 refinement needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
equinor/radix-operator#1979 ·
-
help wanted kind/documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
liquidmetal-dev/flintlock#1239 ·