-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 basic Dockerfile #650
base: master
Are you sure you want to change the base?
Add basic Dockerfile #650
Conversation
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.
- minimum required java version is 8 (also openjdk 11 has ssl issues on some systems)
- this builds src, which is kinda unsupported
- probably doesn't need to build src each time
- Edit: /usr/local/bin/JMusicBot.jar might be a good place or in ~/bin/ or ~/.local/bin/
Also probably should switch to some random, non-root user in the Dockerfile. |
no its not the latest LTS release but whatever.
maybe check if the jar exists in your workdir, if not run maven for building the jar, else skip to executing the jar.
|
Thanks for all the feedback! |
|
Well, I use docker for a living for years now. Would love to be pointed to any sort of way to branch Dockerfile. See for example: It makes a lot of sense - such approach makes images not reproducible. The only possibility is to whitelist "target" directory in dockerignore and copy both it and the source together, then in RUN directive in bash, decide if it's needed to run maven. This has many issues - what if target directory has old binary? Also we loose all of the caching that Docker provides - any smallest change to target dir, that doesn't result in appropriate jar being there, will invalidate the caches. Could you please point me to any documentation in regards to this? I'd love to learn about it. |
Is there an update on this? This seems to be a pretty sensible docker file to me. To throw my 2 cents into it... 1.minimum required java version is 8 (also openjdk 11 has ssl issues on some systems) 2.this builds src, which is kinda unsupported 3.probably doesn't need to build src each time Of the other docker file suggestions this one seems good. I dont know why its not been merged yet. |
In general, adding a supported docker file is on-hold until this script is rewritten. |
What specially are you looking for? The same functionality written in java? |
No, the script already works correctly, it just isn't ideal for platforms like docker yet because it uses values set within the script instead of using flags. TLDR the script should support An ideal docker file would just download and run the script |
@jagrosh unfortunately I'm busy for a few more weeks, but if you'd create an issue describing what needs to be rewritten, I might take a look at it and PR it. Always a good excuse to write more bash :) |
Oh, that's simpler than I thought you might want. Should I include this in this or a separate PR? |
@Prof-Bloodstone Sorry if I came off combative. My response was more directed at Sanduhr32's requests to fix the docker file when what you have is pretty standard. |
Well that's the short version, because there are still other problems I need to figure out. For example, generating the config file the first time would require some separate logic (both in the script and in the jar). |
@jagrosh The base for your future changes to that script: #981
You want dockerfile to have nothing other than just the script and dependencies, and then download them on start? That sounds bad :/ |
This pull request...
Description
This PR adds a very basic Dockerfile. Packaged it for myself, but someone else might also find it useful.
It uses multi-stage builds, greatly decreasing the size of the final image. If you also want to provide docker image downloads, both docker-hub and quay.io has automatic builders so there isn't need to configure much.
I've decided to put the jar in the rootfs because I never really know of a better UNIXy place. Open to suggestions.