-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dockerfile and docker build action #192
Conversation
It would be great to have todocheck as prebuilt container. e.g. this would make integration in CI systems easier, as running jobs as container has become the defacto standard. |
Also relates to #83 |
👋 @preslavmihaylov just curious if you would have the time to review this any time soon (no pressure though 😅)? Would greatly improve things on our end 🙂. If you need any additional information from me, please don't hesitate to ask. |
@Jasper-Ben I'm not sure this is going to work. When I copied your
Afterwards, I created a folder with
And a
After I run:
I get the following error:
I believe this is because todocheck is running in the context of its container, rather than my local file system. |
Hi! docker run -it -v /path/to/project/on/host:/project -e TODOCHECK_AUTH_TOKEN=<token> todocheck:test --basepath /project I will update the README. |
Also another thing I noticed is that you add some versioning during the build of todocheck: https://github.com/preslavmihaylov/todocheck/blob/master/Makefile#L5 This currently is not the case with the docker build. I don't think it is a huge deal, since the docker tag itself can be used to identify the version, but if you say that needs to be amended, I could take a look into it. |
I think a more sensible approach would be to configure the docker image build to be done on new releases & it should match the version of the release. |
This (and more) is basically what the GitHub action will do. If you tag and push a git commit, the GitHub action will automatically build and tag the docker image appropriately. Optionally, but from experience recommended (minimum: at least for the master branch), It also builds and pushes an appropriately tagged docker image for a push to any branch, keeping the latest (head of branch). This is useful if a certain feature is required but hasn't been merged or released yet. The user of the software therefore could opt to use the image for the latest master branch commit until the next release is available. |
I'll make a todocheck fork & play around with this to validate that it works correctly |
Hey @Jasper-Ben I managed to play around with this in a fork & set it up nicely. Check out #200 Via those changes:
Would you like to replicate those changes in this PR so that I can merge it? I could just merge that one, but I don't want to steal the credits :) |
Adds support for container builds. Github action will automatically build images on master branches and on releases and push them to the github container registry.
Done :) I've done some further cleanup to the Dockerfile (removed unnecessary |
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.
Thanks for the contribution!
Add Dockerfile. Also, build, tag and push docker image on push