rest-server
rest-server copied to clipboard
Fix 125
What is the purpose of this change? What does it change?
This PR fixes #125 by creating docker images on every git tag and automatically push them to Dockerhub. To make that work, the Dockerfile was changed to a multi-stage build, which makes it also easier because you don't need to have go installed when doing a docker build locally. Please create the two secrets in Settings / Secrets
- DOCKER_USERNAME
- DOCKER_TOKEN Whenever you tag a new release, the workflow is triggered and creates an image for linux/amd64 and linux/arm/v7. This image is also tagged as latest. => Please tell if you want additional platforms supported.
For the Dockerfile, I tried to follow best practices - I know there is a bit of a range there. I prefer to have all additional files in a separate directory, that's why I changed the existing part of the docker build.
Was the change discussed in an issue or in the forum before?
Closes #125 (as soon as there is a new tag after this PR is merged).
Checklist
- [x] I have enabled maintainer edits for this PR
- [x] I have added tests for all changes in this PR (none needed)
- [ ] I have added documentation for the changes (in the manual) (will happily do it if you think this PR is a good idea)
- [ ] There's a new file in
changelog/unreleased/
that describes the changes for our users (template here) (see above) - [x] I have run
gofmt
on the code in all commits (not needed) - [x] All commit messages are formatted in the same style as the other commits in the repo
- [x] I'm done, this Pull Request is ready for review (Feedback welcome!)
Nice! Are the docker secrets already available in this repo?
I prefer the (less extensive) Dockerfile changes made in #145.
So what about merging #145 first and then I could rebase so that this PR only provides the github actions part?
Regarding the docker hub secrets, I don't think that these are currently available to the CI. That would be up to @fd0 to decide on and provide those.
The secrets have to exist first. Without them, this PR doesn't make much sense. That's up to you to decide.
I've merged #145 instead of the Dockerfile changes here.