Closed B1F030 closed 6 days ago
Hi @B1F030, would you like to contribute a PR?
I wonder how these dangling images were created. Is there a way to avoid them?
docker image prune
will remove all dangling images even those not created by Karmada. Is this the desired behavior?
refer to https://docs.docker.com/config/pruning/
The docker image prune
command allows you to clean up unused images. By default, docker image prune only cleans up dangling images. A dangling image is one that isn't tagged, and isn't referenced by any container. Thus docker image prune -f
is valid and will only clean up dangling images
how these dangling images were created
The common ways are:
Hi @B1F030, would you like to contribute a PR?
Sure.
I wonder how these dangling images were created. Is there a way to avoid them?
These images are generated because every time we run the hack/local-up-karmada.sh
, in #step2. make images
, the command make images
will be triggered, refer to hack/docker.sh
, and that's necessary because we need to make sure the source will be updated in each run.
Two ways to resolve this problem:
imagePullPolicy
to Always
to sync with the latest version in repository.
docker image prune
will remove all dangling images even those not created by Karmada. Is this the desired behavior?
Generally, dangling images have lost their value of existence and can be deleted at will. They are generated because:
But on the other hand, keeping dangling images could help to accelerate image building by using cache layer.
What would you like to be added: Clean up dangling images after each run of
hack/local-up-karmada.sh
.Why is this needed: When we use
hack/local-up-karmada.sh
to start a demo environment for more than one times, there will be a lot of dangling images like this:Could be resolved by adding a command in script like this:
docker image prune -f
.