Save docmachine image in local cache #2
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
glenux/docmachine-cli#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There is no way to avoid having the image being pruned, and image gets downloaded over and over again.
To avoid unnecessary pull, we should follow the strategy below:
Ex:
~/.cache/docmachine/docmachine.TAG.tar.bz2Contexte/etat actuel dans le code (HEAD
8da1820):docmachine buildest danssrc/build/run.cr#_pull_image.~/.cache/docmachine/image.tar(ou$XDG_CACHE_HOME/docmachine/image.tar).enable_cacheest desactive par defaut et non exposé dans la CLI (voir issue #21).Pistes complementaires (non couvertes ici):
image.tarpartage), + metadata/digest pour verifier que l'archive correspond bien a l'image demandee.docker run --pull=neverpour garantir qu'un run ne telecharge jamais si on veut forcer le cache.Je propose d'ouvrir des tickets dedies pour ces points (sauf si on prefere enrichir celui-ci).
image.targlobal) #28docker run --pull=never)image.targlobal)Implemented minimal fix to skip cache/pull when the image already exists locally.
Details:
image_exists?(image_tag)to the container engine interface and implemented it for Docker (docker image inspect) and Podman (podman image exists)._pull_imageshort-circuits when the image is already present locally.Files touched (core):
src/build/run.crsrc/container/abstract_container_engine.crsrc/container/docker_engine.crsrc/container/podman_engine.crspec/build/run_spec.crspec/support/container_stub_engine.cr