There was a failure for a build in our system that looked like this:
docker build -t yiorgos/my-cool-application:service/1.1.2 .
invalid argument "yiorgos/my-cool-application:service/1.1.2" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
Sometimes you get this error when you forget a space between the dot (the current directory where your Dockerfile
usually lives and the tag). But this was not the case. Docker actually did not like the tag for the image.
My hunch was that it does not like slashes inside the actual tag part (right of the :
).
And indeed by checking out the source code of podman we that this is indeed the case:
// tag := /[\w][\w.-]{0,127}/
reference.go contains the full specification of a tag for anyone interested.