Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

delete() leaves layers with <none> #75

Open
chamilad opened this issue Jan 27, 2017 · 4 comments
Open

delete() leaves layers with <none> #75

chamilad opened this issue Jan 27, 2017 · 4 comments

Comments

@chamilad
Copy link
Contributor

I'm trying to delete an image using the following code, but what it actually seems to do is to only delete the layer tagged with the given image name. After the operation is completed, there is a new <none> entry when docker images is run.

client.image().withName(imageName).delete().force().andPrune();
@iocanel
Copy link
Member

iocanel commented Feb 1, 2017

I'll have a look.

@iocanel iocanel self-assigned this Feb 1, 2017
@iocanel
Copy link
Member

iocanel commented Feb 1, 2017

@chamilad: I don't see an issue here. Can you please paste the output of docker images before and after the command as long as the output of the command?

@chamilad
Copy link
Contributor Author

chamilad commented Feb 8, 2017

@iocanel, Yes. I had it wrong. The corrected code is as follows.

client.image().withName(imageName).delete().force().andPrune(false);

However, shouldn't this be noPrune() or andPrune(true) for readability? When reading the code at a glance, it looks like I don't want to prune the parent layers, because prune(false).

@iocanel
Copy link
Member

iocanel commented Apr 8, 2018

I'll try to address that readablity issue in future releases.

@iocanel iocanel removed their assignment Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants