gp-docker-action
gp-docker-action copied to clipboard
Allow using the repository name as the image name
Currently, the full name of the image is <repo><image name>:<image tag>. However, my repository produces a single docker image. As a result, I would like for it to be <repo>:<tag>, so, I do not need the extra image name.
Can we make the image name parameter optional? Or maybe a flag to indicate this requirement which makes process not use the image name?
Alternatively, a flag to remove name of the repository (while keeping the name of the account). This way the image's URL will be ghcr.io/<account name>/<image name>:<image tag>.
This option will support the original request while also allowing the user to control the image name
Sadly, I have to deny this suggestion.
Docker Images in the GCR of one user or organisation share the same namespace. If we omit RepoName from the Docker Image path, we could namesquat images from other repos.
Imagine, I have two repos: repo-1 and repo-2, and In each of them I try to build an image called service. Current implementation of my action will publish them as ghcr.io/vaultvulp/repo-1/service:latest and ghcr.io/vaultvulp/repo-2/service:latest.
But if we ommit RepoName, then both Docker images will have the same name: ghcr.io/vaultvulp/service:latest, thus overwriting one another.