Pulizia: dice quale store delle immagini usa il demone, da cui dipendono le 24 ore
I documenti dicevano che le 24 ore di «image prune --filter until» contano sempre dalla costruzione dell'immagine. Vale solo con lo store classico; con quello di containerd, predefinito nelle installazioni nuove di Docker Engine dalla 29, Docker confronta il momento in cui il nome è arrivato sul demone, che un nuovo pull dello stesso nome non cambia. La prova invece calcola l'età dalla costruzione, quindi con containerd prova e pulizia vera possono non coincidere, nei due sensi (rilievo della revisione, controllato sul codice di moby). Nei modi «settimanale» e «completa» la pulizia legge lo store con docker info e lo scrive all'inizio; con containerd, o se docker info non risponde, la prova avverte che le età che elenca sono solo indicative. docs/processo.md dice come vanno le cose con l'uno e con l'altro, anche per le immagini costruite con una data fissa. Il demone finto delle prove sa rispondere come l'uno e come l'altro. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
483d57b89a
commit
e24ebd24f0
5 files changed
+78
-3
No files matched your search
@@ -25,6 +25,8 @@
|
||||
# $FAKE_DOCKER_WORLD/images id|names (comma separated; empty: dangling)|minutes ago|labels|size
|
||||
# $FAKE_DOCKER_WORLD/volumes name|minutes ago (missing: just created)
|
||||
# $FAKE_DOCKER_WORLD/networks id|name|minutes ago
|
||||
# $FAKE_DOCKER_WORLD/store optional: «containerd» for the containerd image store (what «docker info» says);
|
||||
# otherwise the classic store of overlay2
|
||||
# $FAKE_DOCKER_WORLD/broken optional: commands («image prune», «builder prune») that fail as if the daemon refused
|
||||
# $FAKE_DOCKER_WORLD/calls every call, one per line (written here), after BUILDX_BUILDER=<value> when it is set
|
||||
set -uo pipefail
|
||||
@@ -463,6 +465,21 @@ network_rm() {
|
||||
drop "$world/networks" "$id"
|
||||
}
|
||||
|
||||
store() {
|
||||
if [[ "$(cat "$world/store" 2> /dev/null)" == containerd ]]; then echo containerd; else echo classic; fi
|
||||
}
|
||||
|
||||
# The DriverStatus of «docker info» as Docker prints it: with the containerd image store the snapshotter, with the
|
||||
# classic one the details of overlay2.
|
||||
info_command() {
|
||||
[[ "$*" == "--format {{json .DriverStatus}}" ]] || unexpected "info $*"
|
||||
if [[ "$(store)" == containerd ]]; then
|
||||
echo '[["driver-type","io.containerd.snapshotter.v1"]]'
|
||||
else
|
||||
echo '[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"],["userxattr","false"]]'
|
||||
fi
|
||||
}
|
||||
|
||||
system_df() {
|
||||
case "$*" in
|
||||
"") echo "TYPE TOTAL ACTIVE SIZE RECLAIMABLE" ;;
|
||||
@@ -511,5 +528,6 @@ case "${1:-}" in
|
||||
esac
|
||||
;;
|
||||
system) [[ "${2:-}" == df ]] || unexpected "$*"; shift 2; system_df "$@" ;;
|
||||
info) shift; info_command "$@" ;;
|
||||
*) unexpected "$*" ;;
|
||||
esac
|
||||
Reference in new issue
Block a user