fabric8io / docker-client

11 stars 13 forks source link

delete() leaves layers with <none> #75

Open chamilad opened 7 years ago

chamilad commented 7 years ago

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 commented 7 years ago

I'll have a look.

iocanel commented 7 years ago

@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 commented 7 years ago

@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 commented 6 years ago

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