docker-builds icon indicating copy to clipboard operation
docker-builds copied to clipboard

LABEL container.version --> LABEL dockerfile.version

Open kapsakcj opened this issue 5 years ago • 2 comments

LABEL container.version is super vague. It should be LABEL dockerfile.version. Intended for tracking multiple versions of a dockerfile for a single program (and it's single version).

For example if I had to make adjustments to the SPAdes 3.14.1 dockerfile (for which there is only one dockerfile version currently), I would bump to LABEL dockerfile.version=2

kapsakcj avatar Jun 02 '20 21:06 kapsakcj

Could you give an example of how you want this to look?

erinyoung avatar Sep 11 '20 18:09 erinyoung

LABEL dockerfile.version="1" for the first iteration of a dockerfile. Then if you had to tweak the dockerfile at a later date, but not change the version of the actual program (SPAdes or whathave you), then I would change it to LABEL dockerfile.version="2" when commiting the edited dockerfile to the repo.

IMO semantic versioning isn't necessary here because I don't expect dockerfiles to change much once they are running smoothly and I would like to keep it simple.

Happy to hear your thoughts on this.

kapsakcj avatar Sep 11 '20 18:09 kapsakcj

The label is correct in the template, right?

https://github.com/StaPH-B/docker-builds/blob/master/dockerfile-template/Dockerfile

@kapsakcj , do you think we need to add/change labels?

erinyoung avatar Oct 07 '22 19:10 erinyoung

Yes, the template has the correct LABEL (dockerfile.version).

The only slight change for the template would be something like this, if multiple people are maintainers or authors of the dockerfile:

LABEL maintainer1="Anders Goncalves da Silva"
LABEL maintainer1.email="[email protected]"
LABEL maintainer2="Curtis Kapsak"
LABEL maintainer2.email="[email protected]"

kapsakcj avatar Oct 07 '22 20:10 kapsakcj

I want to ensure that each docker image has the recommended labels, so I added a check in https://github.com/StaPH-B/docker-builds/pull/499.

I had a difficult time adding wildcards when using docker inspect to look at labels, so I'm going to recommend that the first maintainer is maintainer and the nth maintainer is maintainer$n. So the recommendation would look like this:

LABEL maintainer="Anders Goncalves da Silva"
LABEL maintainer.email="[email protected]"
LABEL maintainer2="Curtis Kapsak"
LABEL maintainer2.email="[email protected]"

erinyoung avatar Dec 01 '22 23:12 erinyoung

I think we can close this issue now.

erinyoung avatar Feb 15 '23 21:02 erinyoung