Add option to docker pull to use local cache first without contacting Docker Hub
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia dal punto di ingresso della CLI di docker pull e traccia il modo in cui il comando gestisce le immagini disponibili localmente e il contatto con il registry. Definisci il comportamento per le immagini memorizzate nella cache e per quelle non memorizzate nella cache, quindi verifica che la nuova opzione ignori il registry quando un'immagine è disponibile localmente, continuando comunque a eseguire il pull quando non lo è.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Currently, docker pull contacts Docker Hub (or another registry), even when the requested image is already present locally and up to date. This behavior:
- Triggers unauthenticated rate limits unnecessarily.
- Makes it unsafe to use
docker pullin CI environments without Docker Hub authentication.
Please consider adding a flag to docker pull that checks the local image cache first and skips contacting the registry if the image is already available locally.
Worst of all, docker pull is currently inconsistent—it sometimes succeeds and sometimes fails, even when the image is already cached locally.
Here is an example where both images are present locally:
Pulling atlassian/bamboo-server
docker pull atlassian/bamboo-server
Using default tag: latest
latest: Pulling from atlassian/bamboo-server
Digest: sha256:b3d33daee6667c15ae3f1a9225bd85f493a23183f4d33776aa7243822d0fa820
Status: Image is up to date for atlassian/bamboo-server:latest
docker.io/atlassian/bamboo-server:latest
Pulling buildkite/agent
docker pull buildkite/agent
Using default tag: latest
Error response from daemon: toomanyrequests: You have reached your unauthenticated pull rate limit. https://www.docker.com/increase-rate-limit
A common workaround is to explicitly check for the image before pulling:
if ! docker image inspect ubuntu:22.04 > /dev/null 2>&1; then
docker pull ubuntu:22.04
fi
Alternatively, pulling by digest avoids the registry check:
docker pull ubuntu@sha256:<digest>
But these approaches are manual and error-prone. A built-in option (e.g. --check-cache-first) would offer a simpler and more robust solution for both local workflows and CI pipelines.
- 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
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
googleapis/librarian#7670 · 2 commenti ·