Skip to content

feat: improve images cleanup in ddev delete images, ddev delete, ddev clean, fixes #5073, fixes #7201#7151

Merged
rfay merged 13 commits into
ddev:mainfrom
stasadev:20250326_stasadev_delete_images
Jun 19, 2025
Merged

feat: improve images cleanup in ddev delete images, ddev delete, ddev clean, fixes #5073, fixes #7201#7151
rfay merged 13 commits into
ddev:mainfrom
stasadev:20250326_stasadev_delete_images

Conversation

@stasadev

@stasadev stasadev commented Mar 26, 2025

Copy link
Copy Markdown
Member

The Issue

How This PR Solves The Issue

  • ddev delete shows shasum for dangling images without name (i.e. without tags).
  • ddev delete images shows images to be deleted before running cleanup.
  • ddev delete images removes leftovers from not properly deleted projects with ddev stop --unlist
  • ddev delete images -a now removes every image created by docker-compose in the project context.
  • ddev delete images cleans leftovers from deleted add-ons.
  • ddev clean can be run inside a project directory.
  • ddev clean -a runs ddev delete images -a under the hood as before.
  • ddev clean runs ddev delete images under the hood (not ddev delete images -a)
  • ddev clean doesn't remove global ~/.ddev/bin
  • Adds message about docker builder prune to the commands above on success.
  • Runs ddev poweroff only when needed, not all the time.

Manual Testing Instructions

Run this with DDEV v1.24.5 (or lower) and project1:

ddev debug download-images
ddev add-on get ddev/ddev-solr
ddev start
ddev add-on remove ddev/ddev-solr

Run this with DDEV v1.24.5 (or lower) and project2:

ddev debug download-images
ddev add-on get ddev/ddev-solr
ddev start

Run this with DDEV v1.24.5 (or lower) and project3:

ddev debug download-images
ddev add-on get ddev/ddev-solr
ddev start
ddev stop --unlist

Switch to this PR and run:

ddev poweroff
ddev debug download-images
ddev start project1 project2 project3
ddev delete images

Expect to see removals for these images:

  • v1.24.5 tags for ddev/ddev-webserver, ddev/ddev-dbserver-*, ddev/ddev-traefik-router, ddev/ddev-ssh-agent, ddev/ddev-xhgui.
  • solr image from project1 and v1.24.5 tags for project1, but not the current ones.
  • v1.24.5 tags for project2
  • all project3 images.
  • check docker ps -a, it shouldn't contain leftovers.

Check out:

ddev delete images -a

The clean command should work in the same way:

ddev clean
ddev clean -a

To test dangling images in ddev delete, rebuild solr several times:

ddev add-on get ddev/ddev-solr
ddev debug rebuild -s solr
ddev debug rebuild -s solr
ddev delete -Oy

The dangling image will be listed with shasum.

Automated Testing Overview

I didn't add any new automated tests because these commands can't be tested with just one ddev binary.

Release/Deployment Notes

@stasadev stasadev force-pushed the 20250326_stasadev_delete_images branch 2 times, most recently from 629f628 to 17bc652 Compare March 26, 2025 17:56
@github-actions

github-actions Bot commented Mar 26, 2025

Copy link
Copy Markdown

@rpkoller

Copy link
Copy Markdown
Collaborator

ideally from my perspective ddev delete images should keep the ddev core images for the current version plus the addon images for current projects, but remove all the ddev core images of previous versions, and dangling addon images for projects that got already deleted

@rfay

rfay commented Apr 11, 2025

Copy link
Copy Markdown
Member

I imagine you'll want to solve

in this one.

@stasadev stasadev force-pushed the 20250326_stasadev_delete_images branch from 17bc652 to 4930d86 Compare June 17, 2025 14:32
@stasadev stasadev changed the title feat: remove all images in ddev delete images feat: improve images cleanup in ddev delete images, ddev delete, ddev clean, fixes #7201 Jun 17, 2025
@stasadev stasadev requested review from rfay and rpkoller June 17, 2025 15:04
@stasadev stasadev marked this pull request as ready for review June 17, 2025 15:04
@stasadev stasadev requested a review from a team as a code owner June 17, 2025 15:04
@stasadev

Copy link
Copy Markdown
Member Author

Ready for review, the OP is updated.

I didn't add any new automated tests because these commands can't be tested with just one ddev binary.

@stasadev

Copy link
Copy Markdown
Member Author

ideally from my perspective ddev delete images should keep the ddev core images for the current version plus the addon images for current projects, but remove all the ddev core images of previous versions, and dangling addon images for projects that got already deleted

@rpkoller, ddev delete images without any flags should now work exactly as you expect.

@rfay

rfay commented Jun 17, 2025

Copy link
Copy Markdown
Member

I used ddev delete images the other day doing some cleanup on my server. It made me sad that it insisted on ddev poweroff, but that's a normal and reasonable requirement. But I did wish it didn't do that and (with permission) stop all my projects on there. It seems like in a perfect world it would be possible to clean up without doing that. IMO doesn't matter for local development, which is DDEV's target.

@rpkoller rpkoller left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the artifact. kept all my backlog of images from plugins as well as ddev core for a while: https://gist.github.com/rpkoller/762009ebf6e004c15121f2525471fea5

i love that none images get cleared now as well. i also had some confusion understanding the exact naming pattern. stas already cleared up that confusion and i can attest the cleanup worked very well in my test. the only nitpick to note is that the output you have to confirm when running ddev delete images is sort of overwhelming :

$> ddev delete images
Warning: the following 7 Docker image(s) will be deleted:
Image to be deleted from ddev-core: sha256:6ef8b6687bb46f4eb5961e73f5ae0dde3325368f0c431cad63a1c2e27c78494f
Image to be deleted from ddev-core: ddev/ddev-webserver:20250213_rfay_mariadb_11.8-core-built
Image to be deleted from ddev-lu: ddev-lu-xhgui:latest
Image to be deleted from ddev-uxmeeting: ddev/ddev-webserver:20250213_rfay_mariadb_11.8-uxmeeting-built
Image to be deleted from ddev-vali: ddev-vali-xhgui:latest
Image to be deleted: ddev/ddev-traefik-router:v1.24.6
Image to be deleted: ddev/ddev-webserver:20250213_rfay_mariadb_11.8
Deleting images is a non-destructive operation.
You may need to download images again when you need them.

OK to continue? [Y/n] (yes): 
Powering off DDEV to avoid conflicts
The ddev-ssh-agent container has been removed. When you start it again you will have to use 'ddev auth ssh' to provide key authentication again.
All DDEV images discovered were deleted.

i am not sure if i really need the list of images to be deleted. it is a non destructive operation that could cause a data loss. you are only deleting images that could be redownloaded anyway. i guess if something happens and i redownload an image then i might investigate. but that would be just inconvenient for the moment. therefore i would think that list is not really needed imho. and if folks think it would be nice to have then i would at least change the sorting. if you run docker image ls you have a sort order from newst to oldest while the sort order on the confirmation output is alphabetical ascending. i would keep the order consistent. or the longer i think about it, that list is just complicating things, i would simply drop it.

p.s. as i wrote to stas, the only context running that feature might be tricky is with DDEV HEAD. that way you can easily delete more than you want. ;) i guess my rule of thumb will be, i will only run that command when the PR pushing the tags for a new release is committed. that way you are on the save end. but for folks on a stable version of ddev core that PR will be convenient and pure bliss. that is solving one of my biggest issues. thank you!

@stasadev

Copy link
Copy Markdown
Member Author

But I did wish it didn't do that and (with permission) stop all my projects on there.

@rfay, I want to use ddev delete images myself in some daily update script I use (which runs many more things).
It would be nice to check if the images we want to remove are running or not. And don't do ddev poweroff when it's not needed.

if you run docker image ls you have a sort order from newst to oldest while the sort order on the confirmation output is alphabetical ascending.

@rpkoller, it's grouped by project, then by name. I tried different sortings, and I'm not sure if newest to oldest will be readable at all.
Maybe it's better to use table here (like in ddev list) so it can be more readable.

it is a non destructive operation that could cause a data loss.

We consider "data loss" only for volumes, not images.

@rpkoller

Copy link
Copy Markdown
Collaborator

thought about it some more. in regard of readability probably the order might now be the most important aspect. it is rather the redundant block of text:

$> ddev delete images
Warning: the following 7 Docker image(s) will be deleted:
Image to be deleted from ddev-core: sha256:6ef8b6687bb46f4eb5961e73f5ae0dde3325368f0c431cad63a1c2e27c78494f
Image to be deleted from ddev-core: ddev/ddev-webserver:20250213_rfay_mariadb_11.8-core-built
Image to be deleted from ddev-lu: ddev-lu-xhgui:latest
Image to be deleted from ddev-uxmeeting: ddev/ddev-webserver:20250213_rfay_mariadb_11.8-uxmeeting-built
Image to be deleted from ddev-vali: ddev-vali-xhgui:latest
Image to be deleted: ddev/ddev-traefik-router:v1.24.6
Image to be deleted: ddev/ddev-webserver:20250213_rfay_mariadb_11.8
Deleting images is a non-destructive operation.
You may need to download images again when you need them.

OK to continue? [Y/n] (yes): 
Powering off DDEV to avoid conflicts
The ddev-ssh-agent container has been removed. When you start it again you will have to use 'ddev auth ssh' to provide key authentication again.
All DDEV images discovered were deleted.

each line for an image is starting with Image to be deleted from that way you have a hard time processing, you have to skim past that redundant snippet in each line. in addition to that the context like ddev-core is hard to distinguish from the actual image name. how about something like?

$> ddev delete images
Warning: the following 7 Docker image(s) will be deleted:
(ddev-core): sha256:6ef8b6687bb46f4eb5961e73f5ae0dde3325368f0c431cad63a1c2e27c78494f
(ddev-core): ddev/ddev-webserver:20250213_rfay_mariadb_11.8-core-built
(ddev-lu): ddev-lu-xhgui:latest
(ddev-uxmeeting): ddev/ddev-webserver:20250213_rfay_mariadb_11.8-uxmeeting-built
Iddev-vali): ddev-vali-xhgui:latest
ddev/ddev-traefik-router:v1.24.6
ddev/ddev-webserver:20250213_rfay_mariadb_11.8
Deleting images is a non-destructive operation.
You may need to download images again when you need them.

OK to continue? [Y/n] (yes): 
Powering off DDEV to avoid conflicts
The ddev-ssh-agent container has been removed. When you start it again you will have to use 'ddev auth ssh' to provide key authentication again.
All DDEV images discovered were deleted.

but looking at the inconsistent and rather confusing context with some images having ddev-core some a name related to project (ddev-uxmeeting), some at the end without any context with just the name. i wonder if the following would be the most straight forward ( i would also rename the sha256 to what it is called with docker image ls -> <none>

$> ddev delete images
Warning: the following 7 Docker image(s) will be deleted:

<none>
ddev/ddev-webserver:20250213_rfay_mariadb_11.8-core-built
ddev-lu-xhgui:latest
ddev/ddev-webserver:20250213_rfay_mariadb_11.8-uxmeeting-built
ddev-vali-xhgui:latest
ddev/ddev-traefik-router:v1.24.6
ddev/ddev-webserver:20250213_rfay_mariadb_11.8

Deleting images is a non-destructive operation.
You may need to download images again when you need them.

OK to continue? [Y/n] (yes): 
Powering off DDEV to avoid conflicts
The ddev-ssh-agent container has been removed. When you start it again you will have to use 'ddev auth ssh' to provide key authentication again.
All DDEV images discovered were deleted.

or as i said drop the listing of the image names entirely? the dont provide much of an additional benefit?

@stasadev

Copy link
Copy Markdown
Member Author

But I did wish it didn't do that and (with permission) stop all my projects on there.

@rfay, done, ddev poweroff will only run if some container uses any of the images to delete.

but looking at the inconsistent and rather confusing context with some images having ddev-core some a name related to project (ddev-uxmeeting), some at the end without any context with just the name. i wonder if the following would be the most straight forward ( i would also rename the sha256 to what it is called with docker image ls -> <none>

@rpkoller, sort by name only, without any projects, show short image IDs:

$ ddev delete images    
Warning: the following 5 Docker image(s) will be deleted:
IMAGE ID       REPOSITORY:TAG
64d94408a746   <none>:<none>
b5e47fc0c220   ddev/ddev-dbserver-mariadb-10.11:v1.24.6
a9574de44849   ddev/ddev-ssh-agent:v1.24.6
3e84b6b15ff1   ddev/ddev-traefik-router:v1.24.6
e887d55b5c2c   ddev/ddev-webserver:v1.24.6
Deleting images is a non-destructive operation.
You may need to download images again when you need them.

OK to continue? [Y/n] (yes): 
All DDEV images discovered were deleted.
Optionally, run `docker builder prune` to clean unused builder cache.

or as i said drop the listing of the image names entirely? the dont provide much of an additional benefit?

I still think it's nice to see a list of what changes are being made here.

@rpkoller

Copy link
Copy Markdown
Collaborator

interesting. when you've mentioned display the images in a table i've automatically thought it would mean the table would have borders (which is thought would look and feel too massive), but without any borders it improves the readability significantly. i like that. the sole two nitpicks.

would it make sense to add a blank line before and after? that way it makes easier to distinguish the textblocks:

$ ddev delete images    
Warning: the following 5 Docker image(s) will be deleted:

IMAGE ID              REPOSITORY:TAG
64d94408a746   <none>:<none>
b5e47fc0c220    ddev/ddev-dbserver-mariadb-10.11:v1.24.6
a9574de44849   ddev/ddev-ssh-agent:v1.24.6
3e84b6b15ff1     ddev/ddev-traefik-router:v1.24.6
e887d55b5c2c   ddev/ddev-webserver:v1.24.6

Deleting images is a non-destructive operation.
You may need to download images again when you need them.

OK to continue? [Y/n] (yes): 
All DDEV images discovered were deleted.
Optionally, run `docker builder prune` to clean unused builder cache.

and the other detail, i am not sure what benefit the image id has on that deletion step. the ID is only needed if you manually want to trigger the deletion for an image with docker rmi. but in that list it doesnt have any value? at least me the image id tells me nothing about the image. would it make sense to drop that column entirely or replace it with a category column. categories could be coarse grained, just something like: ddev core, ddev addon, docker ... that way one gets a rough context this line/image belongs to core that one to an addon and that one is just a docker image like for example none? meaning having a rough categorization to what an image belongs to i would consider helpful distinguishing the list.

@stasadev

stasadev commented Jun 18, 2025

Copy link
Copy Markdown
Member Author

would it make sense to add a blank line before and after?

Okay.

i am not sure what benefit the image id has on that deletion step

The IMAGE ID column is the primary identifier.

One use case: run ddev delete images, don't agree to remove anything, read the image list, notice a suspicious <none>:<none> or another image, copy the ID, and check its details with docker inspect <image-id> in another terminal window.

would it make sense to drop that column entirely or replace it with a category column. categories could be coarse grained, just something like: ddev core, ddev addon, docker ...

This will only add more complexity to the code, it should already be clear what kind of image it is, as long as it's not <none>:<none>.

@rfay

rfay commented Jun 18, 2025

Copy link
Copy Markdown
Member

I see

Optionally, run docker builder prune to clean unused builder cache

Shouldn't it be docker buildx prune ?

@rfay

rfay commented Jun 18, 2025

Copy link
Copy Markdown
Member

Trying to save away my 182 images before testing. It's probably not worth the effort, because the restore will be too costly.

docker save $(docker images -q) | gzip > /tmp/all-images.tar.gz

A better approach would probably be a copy of (Orbstack) in this case images directory. That's also probably too costly.

@stasadev

Copy link
Copy Markdown
Member Author

Shouldn't it be docker buildx prune ?

No, because buildx is specific to Buildx, while builder runs any command for the builder in use.

@rfay

rfay commented Jun 18, 2025

Copy link
Copy Markdown
Member

I'm sure you're right, but on my server I get this:

rfay@ddevprod:~$ docker builder prune
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

WARNING! This will remove all dangling build cache. Are you sure you want to continue? [y/N]

I assume it's complaining because I'm using the legacy builder, not because I'm using docker builder. (I see the warning when I just do docker builder as well.

I do not see the warning on macOS where I'm using buildx:

rfay@rfay-mba-m4:~/workspace/ddev$ docker builder prune
WARNING! This will remove all dangling build cache. Are you sure you want to continue? [y/N]

So I'm sure you're right and it's just poor messaging from the docker CLI.

@stasadev

Copy link
Copy Markdown
Member Author

I also have 'docker-buildx' installed and docker builder prune doesn't complain to me.

@rfay

rfay commented Jun 18, 2025

Copy link
Copy Markdown
Member

This is not a request for changes or extra investigation, but I do see one or two suspicious images after ddev delete images -a (edited list)

REPOSITORY                                                                           TAG                      IMAGE ID       CREATED         SIZE
ddev/ddev-webserver                                                                  <none>                   be381812ac90   5 days ago      1.21GB
vsc-ddev-45e804f67f32a6616b4a214fafc6d4bc3e9be3135f5df8fbd6edd62e85c1eb25-features   latest                   8b21a7582369   3 weeks ago     3.3GB
opensearchproject/opensearch-dashboards                                              3.0.0                    a649ef48e6ff   6 weeks ago     1.64GB
redis                                                                                7                        11457eb59fe5   7 weeks ago     147MB
adminer                                                                              standalone               ed7c8a62c220   2 months ago    118MB
phpstorm_helpers                                                                     PS-243.25659.45          2dc29e561d7c   2 months ago    4.2MB
adminer                                                                              5.1.0-standalone         c313cf8b0ea9   2 months ago    118MB
opensearchproject/opensearch-dashboards                                              latest                   2b8f3a2f88a8   3 months ago    1.46GB
postgres                                                                             16                       ae29dcde45c8   3 months ago    457MB
bitnami/mariadb                                                                      10.6.18-debian-12-r0     962ca1adea62   13 months ago   413MB
busybox                                                                              stable                   0496d33b146b   2 years ago     4.04MB
phpmyadmin                                                                           5.2.0                    cdc96bbdba0b   2 years ago     479MB
traefik                                                                              2.2.0                    269e148e952b   5 years ago     72.3MB

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work on this.

ddev clean in a project context seems to delete the ~/.ddev/bin contents, which breaks any other project that might be running. And it even breaks the running project.

I think ddev clean should stop the running project, and shouldn't delete ~/.ddev/bin unless ddev clean -a

(It also doesn't seem to warn about the deletion of ~/.ddev/bin in any case.)

Should ddev clean -a delete the project_list.yaml and/or global_config.yaml ? (I'd probably think it's better to leave them alone.)

rfay@rfay-mba-m4:~/workspace/d11simple$ ddev clean
Warning: snapshots for the following project(s) will be permanently deleted:
No snapshots found for project d11simple

Are you sure you want to continue? [y/N] (no): y
Deleting snapshots and downloads for selected projects...
Deleting unused Docker images that DDEV created...
Finished cleaning DDEV projects.
Optionally, run `docker builder prune` to clean unused builder cache.
rfay@rfay-mba-m4:~/workspace/d11simple$ ls ~/.ddev/bin
ls: /Users/rfay/.ddev/bin: No such file or directory
rfay@rfay-mba-m4:~/workspace/d11simple$ ddev list
┌───────────────────┬────────────────────────────────────────┬───────────────────────────────┬─────────────────────────────┬──────────┐
│ NAME              │ STATUS                                 │ LOCATION                      │ URL                         │ TYPE     │
├───────────────────┼────────────────────────────────────────┼───────────────────────────────┼─────────────────────────────┼──────────┤
│ d11               │ running (failed to Mutagen sync list d │ ~/workspace/d11               │ https://d11.ddev.site       │ drupal11 │
│                   │ 11: stderr='', err=fork/exec /Users/rf │                               │                             │          │
│                   │ ay/.ddev/bin/mutagen: no such file or  │                               │                             │          │
│                   │ directory nosession for MUTAGEN_DATA_D │                               │                             │          │
│                   │ IRECTORY=/Users/rfay/.ddev_mutagen_dat │                               │                             │          │
│                   │ a_directory)                           │                               │                             │          │
├───────────────────┼────────────────────────────────────────┼───────────────────────────────┼─────────────────────────────┼──────────┤
│ d11simple         │ running (failed to Mutagen sync list d │ ~/workspace/d11simple         │ https://d11simple.ddev.site │ drupal11 │
│                   │ 11simple: stderr='', err=fork/exec /Us │                               │                             │          │
│                   │ ers/rfay/.ddev/bin/mutagen: no such fi │                               │                             │          │
│                   │ le or directory nosession for MUTAGEN_ │                               │                             │          │
│                   │ DATA_DIRECTORY=/Users/rfay/.ddev_mutag │                               │                             │          │
│                   │ en_data_directory)                     │                               │                             │          │
├───────────────────┼────────────────────────────────────────┼───────────────────────────────┼─────────────────────────────┼──────────┤
│ ddev.com          │ stopped                                │ ~/workspace/ddev.com          │                             │ php      │
├───────────────────┼────────────────────────────────────────┼───────────────────────────────┼─────────────────────────────┼──────────┤
│ hobobiker         │ stopped                                │ ~/workspace/hobobiker.com     │                             │ drupal6  │
├───────────────────┼────────────────────────────────────────┼───────────────────────────────┼─────────────────────────────┼──────────┤
│ my-sveltekit-site │ stopped                                │ ~/workspace/my-sveltekit-site │                             │ generic  │
├───────────────────┼────────────────────────────────────────┼───────────────────────────────┼─────────────────────────────┼──────────┤
│ t3v13             │ stopped                                │ ~/workspace/t3v13             │                             │ typo3    │
├───────────────────┼────────────────────────────────────────┼───────────────────────────────┼─────────────────────────────┼──────────┤
│ Router            │ OK                                     │ ~/.ddev                       │ http://127.0.0.1:10999      │          │
└───────────────────┴────────────────────────────────────────┴───────────────────────────────┴─────────────────────────────┴──────────┘

@stasadev

Copy link
Copy Markdown
Member Author

Should ddev clean -a delete the project_list.yaml and/or global_config.yaml ? (I'd probably think it's better to leave them alone.)

I also believe that it should not touch these files.

I think ddev clean should stop the running project, and shouldn't delete ~/.ddev/bin unless ddev clean -a

Agreed, will change the logic.

(It also doesn't seem to warn about the deletion of ~/.ddev/bin in any case.)

Good point.

@rfay

rfay commented Jun 18, 2025

Copy link
Copy Markdown
Member

It does look like we might be leaving busybox out there, because we use it without touching it? Here's after ddev clean -a on my Docker Desktop provider. I'm not convinced it's necessary that we delete busybox.

rfay@rfay-mba-m4:~/workspace/ddev$ docker images
REPOSITORY         TAG                IMAGE ID       CREATED        SIZE
redis              7                  7df1eeff67eb   7 weeks ago    195MB
phpstorm_helpers   PS-251.23774.436   df3c5c109475   2 months ago   6.3MB
<none>             <none>             01cf6854e23d   3 months ago   106MB
postgres           16                 cef2d22004db   3 months ago   636MB
alpine             latest             a8560b36e8b8   4 months ago   12.8MB
busybox            latest             37f7b378a29c   8 months ago   6.02MB
busybox            stable             7a5342b7662d   2 years ago    6.02MB

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it seems great to me. Minor suggestions in previous reviews and comments, that can be handled as you see fit. But I sure like it, and it doesn't seem to have any risk factors either.

@rfay

rfay commented Jun 18, 2025

Copy link
Copy Markdown
Member

Tested this on all my other docker providers, colima, lima, rancher, Docker Desktop. In each case it did marvelous cleanup things, just as I'd hope.

@rfay

rfay commented Jun 18, 2025

Copy link
Copy Markdown
Member

This fixes

also, true?

@stasadev stasadev changed the title feat: improve images cleanup in ddev delete images, ddev delete, ddev clean, fixes #7201 feat: improve images cleanup in ddev delete images, ddev delete, ddev clean, fixes #5073, fixes #7201 Jun 19, 2025
@stasadev

Copy link
Copy Markdown
Member Author

All requested changes have been implemented.

@stasadev

stasadev commented Jun 19, 2025

Copy link
Copy Markdown
Member Author

I tested it again, and postgres:x-y-built images are always removed.

I'll try to fix it.

Edit: fixed.


It does look like we might be leaving busybox out there, because we use it without touching it? Here's after ddev clean -a on my Docker Desktop provider. I'm not convinced it's necessary that we delete busybox.

What I've noticed over time: we use busybox:stable and JetBrains uses busybox:latest 🙂


Another thing I noticed: if the image doesn't have a specific ddev version in its tag, it won't be rebuilt later.

So if users update ddev and use something like ddev/ddev-solr, the already built Solr image won't be rebuilt with the new ddev.

This could be solved by always setting the image: field, but that's outside the scope of this PR.

@rpkoller

Copy link
Copy Markdown
Collaborator

This fixes

also, true?

not completely. the none images are still being created in the first place. the cleanup got now way more convenient with this PR.

@rfay

rfay commented Jun 19, 2025

Copy link
Copy Markdown
Member

The none images are a feature of docker buildx and this is going to be as close as we get to fixing IMO.

@rfay rfay merged commit 655a0a6 into ddev:main Jun 19, 2025
18 checks passed
@rfay rfay deleted the 20250326_stasadev_delete_images branch June 19, 2025 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants