Repository navigation
Docker conventions and thoughts - #1212
Conversation
|
Thanks! What is the improvement here? (sorry I'm kind of a docker newb ;))
Can we deploy a new docker image everytime travis runs successfully or for every tagged release or something? |
|
The improvement is that most of the people are using an entrypoint and then a command: when the docker starts, it run the entrypoint + command. In the entrypoint (here ./graphhopper web), you put the basics that normally a user won't owerride, the command is used by the final user to put its options (here the map that the server will run). We could also declare some of the environment variables in the Dockerfile and override them if needed (as the JETTY_PORT or the JAVA_OPTS), but I do not know what should be the basic behavior. You will deploy a new image, every time travis runs correctly. The image that corresponds to the master branch will automatically be tagged with latest (no specific tag is needed), and for the stable, you will just add the number of the version as a tag. You could also add a tag docker on every stable branch that needs to be deployed. In travis, you should also be able to recover the name of the branch. With these improvements, people will be able to run graphhopper without downloading the git repo. You will just need in the dockerfile 'FROM graphhopper/graphhopper' or in the docker-compose to use 'image: graphhopper/graphhopper' I hope that it's clearer. |
|
I love the idea of having you guys maintaining your own DockerHub account and push out some images. Github/ Docker Hub is if full of people/projects who have done it for their own in the past and I think it will be good to publish your own. Even just for centralising all discussions and best practices in a single place which is trusted by people. As @legraina already mentioned, there are enough people who are willing to lend a helping hand. I would not mind helping out a bit on the docker (or Kubernetes) side. We have been using GH for about two years in a Docker / Kubernetes set-up! Some comments on the Dockerfile. I personally always tend to use a fixed version of Java SDK's base images. We are now using |
|
I have updated the Dockerfile to have all the necessary information. The docker can be run with: docker build -t graphhopper .
docker run -v /absolute/path/to/data/:/data -p 80:11111 graphhopper |
|
Would you mind squashing the commits and also add yourself to contributors file and state that you accept the CLA? (can be same or different commit but signed) @Dexyon would you mind to have a look into these changes here? |
|
I think I've done everything needed (I'm not sure as it's the first time I'm using squash and signing a commit). |
|
Would you state "agrees to the project's CLA" also in the contributors file? Also I need just two (or one) commits, currently there are 9. Another possibility would be to create a new pull request with just the CLA and 1 signed commit that I would merge. Then I could squash&merge on my own and no more complication. (see #1208) |
4577a82 to
388ad96
Compare
|
I think it's correctly done now. Do you need any help for creating the docker image on DockerHub ? |
|
Thanks!
We would need to find an automated way to avoid any manual triggers. Is this somehow possible after e.g. a github release/tag? |
|
It can been done really easily on DockerHub. You don't need any tag, you just need to grant access on DockerHub to all your git repositories. I can create everything and then transfer ownership. Is graphhopper a great name for the organization and the docker image ? |
|
I think I've done something that publishes the latest stuff :) ? |
|
I've seen that you have added the stable flag, however I've realized that the corresponding Dockerfile (for the branch 0.9) is not working the same way. I think you should add the stable tag when the branch 1.0 will be pushed. |
|
There will no 1.0 in the near future or do you mean 0.10? Maybe I can modify 0.9 and use the latest Dockerfile? |
|
Yes, I mean 0.10. You can modify the 0.9, it should work !! |
|
The dockerfile looks fine. I usually try to take a more specific version of the Java JDK instead of relying on the latest tag here. But that is just my opinion. Latest and greatest is also a good choice :) |
I've modified the Dockerfile and the docker-compose to use Docker conventions.
You now have an entrypoint in the Dockerfile and only a command in the docker-compose.yml file.
What's more, I think you should create your own docker image on docker hub (https://docs.docker.com/docker-hub/repos/#searching-for-images) and also perhaps create automatic builds (https://docs.docker.com/docker-hub/github/#github-service-hooks). I could do it, but I think you should create your own ids and organization on docker hub. I could also provide help if necessary.