I've a Dockerfile starting with the official nginx image.
FROM nginx
And they set the maintainer label.
LABEL maintainer="NGINX Docker Maintainers <[email protected]>"
So, now my image appears to also be maintained by them.
$ docker image inspect example-nginx
...
"Labels": {
"maintainer": "NGINX Docker Maintainers <[email protected]>"
},
The documentation mentions how to overwrite the label. But, so far, the best I can do is set it to an empty value.
LABEL maintainer=
$ docker image inspect example-nginx
...
"Labels": {
"maintainer": ""
},
How do I completely remove or unset a label set by a parent image?
Great question. I did some research and, as far as I know, it's not possible with the current Docker/Moby implementation. It's also a problem for other properties as well, as you can see here (the issue is from 2014!):
https://github.com/moby/moby/issues/3465
I know it's really annoying, but, if you really want to remove that you can try following this:
https://github.com/moby/moby/issues/3465#issuecomment-383416201
The person automatized this process with a Python
script that seems to let you do what you want:
https://github.com/gdraheim/docker-copyedit
It appears to have the Remove Label operation (https://github.com/gdraheim/docker-copyedit/blob/92091ed4d7a91fda2de39eb3ded8dd280fe61a35/docker-copyedit.py#L304), that is what you want.
I don't know if it works (I haven't had time to test that), but I think it's worth trying.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With