docker-gen
docker-gen copied to clipboard
docker-gen incorrectly parses the user name part of the Docker image as the registry
docker-gen incorrectly parses the user repository part of an image name as the registry name. For example, for an image named "tianon/centos", docker-gen will consider that "tianon" is the registry, whereas it's the user repository.
The bug is in the splitDockerImage function: the current logic is to consider anything before the first '/' as the registry name, which is incorrect.
The correct logic can be seen from the Docker source code. If the part before the first '/' has a dot or a colon or if it's equal to "localhost", then it's the registry, otherwise it's the user repository.