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

docker-gen incorrectly parses the user name part of the Docker image as the registry

Open gregschlom opened this issue 9 years ago • 0 comments

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.

gregschlom avatar Jan 15 '16 23:01 gregschlom