hpc / charliecloud

Now hosted on GitLab.
https://gitlab.com/charliecloud/main
Apache License 2.0
312 stars 60 forks source link

`docker-clean.sh` is stale #1888

Closed lucaudill closed 2 months ago

lucaudill commented 7 months ago

I was using docker-clean.sh and noticed that it didn't get rid of everything in Docker storage:

$ sudo docker image list
REPOSITORY          TAG       IMAGE ID       CREATED        SIZE
foo2                latest    47ea099452d9   2 months ago   212MB
fooo                latest    d8b685302216   2 months ago   7.46MB
tmpimg              latest    99fc1605c863   3 months ago   149MB
registry            2         e56655e0dde9   3 months ago   24.9MB
tmpimg.kfzrfc       latest    3c2f5334f721   5 months ago   0B
tmpimg.5blzey       latest    2ffc97752f09   5 months ago   0B
converted-alpine1   latest    af7caa1e139a   5 months ago   7.4MB
tmpimg.mkxbag       latest    f2c3b6473641   5 months ago   0B
<none>              <none>    fce40be6c65d   5 months ago   149MB
<none>              <none>    e6821cf0cd27   5 months ago   149MB
<none>              <none>    a79d7af30883   5 months ago   149MB
alpine              3.17      8650cd65339b   7 months ago   7.39MB
docker_pull         latest    8650cd65339b   7 months ago   7.39MB
$ ./docker-clean.sh 
found 5 containers
79d1074dc33e
a9795076dc9d
dd6b75066d32
5a0db9805a4a
a00e7eab8df7
found 0 containers
found 10 tagged images
Untagged: foo2:latest
Deleted: sha256:47ea099452d9b3aac43cd53ba00841b0f8116a24be990d283967b7b498cf686a
Deleted: sha256:15da1dd91b5588617364b493064198ac104ddeb3ea05f4271ceac356afbeaf6d
Untagged: fooo:latest
Deleted: sha256:d8b6853022160beb26000619b8fc22e370a8fe587fa45744fc821d1153136483
Deleted: sha256:f49b083ee7398abc396f3aba2de141c3ea449407b14cba6aeba754a28c3655d6
Untagged: tmpimg:latest
Deleted: sha256:99fc1605c8634774cd1fa35179a9b06e785da6c721ceb8073ab093ec9b3c27e7
Untagged: registry:2
Untagged: registry@sha256:0a182cb82c93939407967d6d71d6caf11dcef0e5689c6afe2d60518e3b34ab86
Deleted: sha256:e56655e0dde91bc61f6ca157985e67ac1098df556df011f9abeb0842766788a6
Deleted: sha256:112f0014aee8d39e3192bfff6f3761c570cf0de87da9f271af0123e295dcadb9
Deleted: sha256:ebf90d27c23ff9864d0a9dd596e05b9215f58502a9ea9fa49cb22591a2c61788
Deleted: sha256:4498100af63684ea807d2572cec3af328ebbbaebe90a271b54b6076d397d11f5
Deleted: sha256:ab1192e00105e9086a41616808850998a792356cae4d311e94d826dfe4035ca1
Deleted: sha256:0faf9b67be60a76d473c955d4de2849da5e99e07fcefb753219631e1e7b608fb
Untagged: tmpimg.kfzrfc:latest
Deleted: sha256:3c2f5334f721ee55deb67cdb230e04383d37452ef2c91ede72f70576a2461168
Untagged: tmpimg.5blzey:latest
Deleted: sha256:2ffc97752f094f81e0a961434158f6018b3496f1c77307c2cd5dee2678437716
Untagged: converted-alpine1:latest
Deleted: sha256:af7caa1e139a980536087d1a71323820fc285584bc0871f8160abed41df2c228
Deleted: sha256:ce6368dd2ba023aab11b2b065a2c6785bc14b2ae5ea02ca786190a7a09f6f71b
Untagged: tmpimg.mkxbag:latest
Deleted: sha256:f2c3b6473641bf8b3ff69fe1a9065d94233d7daabf83ad8f02847cd09f30c795
Deleted: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Untagged: alpine:3.17
Untagged: alpine@sha256:f71a5f071694a785e064f05fed657bf8277f1b2113a8ed70c90ad486d6ee54dc
Untagged: docker_pull:latest
Deleted: sha256:8650cd65339b8a253f8b17ef7b63d4e2eb1ee05f00f2ae90aa74366e58ca45f7
Deleted: sha256:d2d9d24a8c2a7ad73a7247738096e24c1ef2c2b02a3690dbf7d63641d26e26cb
found 0 tagged images
$ sudo docker image list
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
<none>       <none>    c4663f875d7b   2 months ago   212MB
<none>       <none>    a58abf15433e   2 months ago   7.46MB
<none>       <none>    b440af5d6d09   3 months ago   149MB
<none>       <none>    5abcd49b8231   5 months ago   7.4MB
<none>       <none>    fce40be6c65d   5 months ago   149MB
<none>       <none>    e6821cf0cd27   5 months ago   149MB
<none>       <none>    a79d7af30883   5 months ago   149MB

Apparently this script was written before ch-image or even ch-grow existed, so it's pretty out of date. Currently it works using some convoluted-seeming Docker operations, but Reid thinks we could do the same thing by simply deleting the Docker storage directory, similar to ch-image reset.

reidpr commented 7 months ago

We could also just delete the script, maybe replace it with a short-ish FAQ entry.