-
Notifications
You must be signed in to change notification settings - Fork 21
Use Git Tags as additional Docker Image Tags #12
base: master
Are you sure you want to change the base?
Conversation
Docker tags. introduce CI simplified identification, introduced ci and fixed metadata non interactive docker login assuming the right context simplification is difficult simplification is difficult 2 do it the complicated way test image_tag function publish 2nd version echoing tags pointing to current commit build tag string fixed a few typos fixed another typo create additional tags based on GIT Tags pointing to the current commit added feature which adds GIT tags pointing to the current commit as docker tags
btw. this was originally a fork of a fork and I somehow wasn't able to sync this PR with your repo. And I'm not able to resolve the conflicts here on Github. |
…-docker-publish # Conflicts: # README.md # action.yml # entrypoint.sh
resolved conflicts. Tests for dockerhub integratoin pending... |
Dockerhub Pushes work now. |
supply github token for test dockerhub specific settings try to make tests "fork agnostic" try to make tests "fork agnostic". still don't know if this works action names cannot be fork agnostic fixed typo
TAG: 'my-optional-tag-name' | ||
DOCKERFILE_PATH: '.github/docker/Dockerfile' | ||
BUILD_CONTEXT: '.' | ||
DOCKERHUB_REPOSITORY: 'pinkrobin/gpr-docker-publish-example' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this repo has authorization to push to this repo
DOCKERHUB_REPOSITORY: 'pinkrobin/gpr-docker-publish-example' | |
DOCKERHUB_REPOSITORY: 'hamelsmu/gpr-docker-publish-example' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's true. This is just intended for testing purposes.
@@ -80,12 +95,15 @@ jobs: | |||
|
|||
1. `cache`: if value is `true`, attempts to use the last pushed image as a cache. Default value is `false`. | |||
2. `tag`: a custom tag you wish to assign to the image. | |||
3. `DOCKERHUB_REPOSITORY`: if value is set, you don't need to set `IMAGE_NAME`. It will push the image to the given dockerhub repository instead of using GPR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this is the best variable name. A Registry is different than an Image Name. Its also confusing to have both of these inputs which makes me wonder if we should rethink the api.
I'm not sure about expanding the scope of this action to include pushing to other registries? There are other Actions for that. The purpose of this Action was to make it easy to push to GPR since there are some nuances for that you don't need to worry about this Action. What do you think? |
Thanks for your review :-D My point of including Dockerhub is this issue here: The tl;dr version is: At the moment it is not possible to pull from public github package registries without providing credentials, which makes this whole Package Registry thing almost unusable. But I do understand your point and if this option is a nogo and we just shall wait for the fix from github side, please just close this PR ;-) |
I'd like to see this PR go in, too! |
I added the functionality to implicitly use Git Tags as additional Docker Tags. Means: If you commit a new Git Tag, an appropriate additional Docker Tag with the same name is going to be created as well.
I fixed a few typos and introduced a Github Workflow to get this action tested.
I already did an integration test by using this functionality here:
https://github.com/saubermacherag/docker-ansible-alpine
The big advantage I see is that you can comfortably draft a realease on Github which implicitly creates a GIT tag which will also become the docker tag.
Due to issue https://github.community/t5/GitHub-Actions/docker-pull-from-public-GitHub-Package-Registry-fail-with-quot/m-p/32782
which basically says, that Github Actions cannot rely on Docker Images on Github's Package Registry without authentication
I also added the DOCKERHUB_REPOSITORY option which allow to push the image to dockerhub instead of GPR.