-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Host docker image on dockerhub #404
Comments
Thanks! Automating docker hub releases as part of the workflow would be cool. Would you happen to know how to do that or where we should look into to start? |
It's pretty straight forward. Lots of repo's on github do it and I see there is very good documentation available: I could offer some assistence to this but I think what you need to do is:
If you use the template, the action trigger is a new release:
You could also add additional actions, for example, push a development version at every merge with the main branch, or in your v0.9-dev branch. I've tried to do this on my fork of your repository and following my instructions above it seems to work: However, you'll want to create a dockerfile that doesn't download the release jar file but one that will build the project itself obviously. The dockerfile should be a little similar to your dockerfile.development but I would create one that completely sets up the project so that you don't have to setup a lot of things when running the container first time. |
Nice, we can automate the dockerhub deployment on releases, then. We need to remember to set the right version number in the docker file at the time of the tag is created, or try to find a way to derive that from the release number. To do the same with a development version, we need to build the executable and put it somewhere, which may be complicated (at the moment, we don't build runnable jars with the java maven actions, for example). |
I've created a dockerfile and edited all the pom.xml files in order to do this automatically. It's in the new merge request. Github has an env called GITHUB_REF that is equal to the release name. I've used this to set the project version in the pom files. Github also automatically assigns the release name to the docker image tag, as well as updates the latest tag. The new dockerfile completely builds the project and handles the resulting server jar file. Some remarks:
And lastly, building the project outside of docker can be done in the usual way. The pom files have a default project version, so if you don't specify |
This is really cool -- we can make intermediate / dev releases much more quickly... I will try a quick release now :) |
Battling with a failed auth on push (weird, auth works on login): |
Wait! I see the repo should include the username... |
It works :) Leaving this issue open so that we update the documentation #201 Another thing to keep in mind is that the convention for release tags has to change and conform with the pom version (0.9-DEV.1 instead of v0.9-DEV.1 -- without v). |
Glad it works :) I'll see if I can help you automating the release artifacts as well. That way, when you create a tag, not only the docker image is pushed automatically but the jar files are also generated and attached to the release. |
Hello,
This project is really exiting! I found out about it this week. I was a bit dissapointed when I couldn't find any docker image on dockerhub.
I prefer to work with docker containers to avoid dependency issues.
The development version of the dockerfile takes a long time to build and deploy. Therefor I've made a pull request that is based on the latest release.
However, it would be even better if you could set up a pipeline that automatically deploys an image (both release and development) on dockerhub.
The text was updated successfully, but these errors were encountered: