43

How can I best indicate that there are multiple authors/maintainers of a docker image built using a Dockerfile? If I include multiple separate MAINTAINER commands, only the last one seems to take effect.

MAINTAINER Me Myself "myself@example.com"
MAINTAINER My Colleague "mycolleague@example.com"

Only mycolleague shows up in the output of docker inspect.

Should I use a comma delimited list in a single MAINTAINER line? Is wanting to list two maintainers a boondoggle and I should just armwrestle my colleague to see whose email we put in the file?

amacleod
  • 1,450
  • 2
  • 15
  • 23
  • I'm looking for a solution as well. Maybe it's just okay to have multiple maintainers in one line? – Kevin Wittek Aug 30 '16 at 08:07
  • Probably, yeah. If `MAINTAINER` is an arbitrary string (or series of whitespace delimited tokens) then I would imagine it fine to put multiple people on one line. I'm just not sure whether there's a common convention for it. – amacleod Aug 30 '16 at 15:22

1 Answers1

81

You can only specify one MAINTAINER instruction in a Dockerfile.

Furthermore, MAINTAINER will be deprecated in the upcoming 1.13.0 release, see deprecations and this pull request.

The recommended solution is to use LABEL instead, e.g.

LABEL authors="first author,second author"

Labels have a key=value syntax. This means you cannot assign the same label more than once and you cannot assign multiple values to a given label. But you can combine multiple values into one with a syntax of your choice as illustrated in the example..

Harald Albers
  • 1,913
  • 16
  • 20
  • 7
    [The current recommendation](https://docs.docker.com/engine/reference/builder/#maintainer-deprecated) is to use `"org.opencontainers.image.authors"` as the **key**, since this a [more widely recognized metadata key](https://github.com/opencontainers/image-spec/blob/main/annotations.md). It is still freeform string **value**. – merv Nov 11 '21 at 14:38
  • 1
    Do you know whether `org.opencontainers.image.authors` should always be the key, or should the first few parts be my own organization's reversed domain, like `com.example.image.authors`? – amacleod May 12 '22 at 15:07
  • 2
    Good question, @amacleod. It seems that exactly `org.opencontainers.image.authors` should be used as the key, since it is specified in the OCI specs, see the referred [OCI image-spec annotations](https://github.com/opencontainers/image-spec/blob/main/annotations.md): "The prefix `org.opencontainers` is reserved for keys defined in Open Container Initiative (OCI) specifications and MUST NOT be used by other specifications and extensions" – Johan Nov 07 '22 at 13:29