-
Notifications
You must be signed in to change notification settings - Fork 18
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 a dockerfile #56
base: master
Are you sure you want to change the base?
Add a dockerfile #56
Conversation
Hi, thanks for taking a look at this. My main concern so far is that it looks like it always pulls down the master branch and compiles from that. While I do try and keep master in a state where it is always running, it seems less than ideal to always be distributing that via docker. I can understand that it could also be tedious to keep bumping the docker image on every minor release as well. Is there perhaps a way to make it always fetch the latest release tag and compile that instead? It seems like there are ways to get the latest git tag from the git CLI, is that something that would fit better do you think? |
The dockerfile itself isn't responsible for obtaining source, it just builds what you have locally. Realistically, for deployment, you'd use a CI server and build on release (which I'm more than happy to set up on my TC instance if needed). |
Thanks. That makes sense but I’m (obviously) not overly familiar with docker. I suppose I should’ve made that connection myself given the lack of any “pull” action in the docker file. I have my own TC instance we would probably want to use to maintain releases, but I’d love to see a test version using your instance if it isn’t too much trouble. kash’s comments about multiple jars should probably be addressed as well. Right now there is always one shaded artifact on build but I imagine we shouldn’t necessarily assume that either. As a docker noob I look forward to your input. |
Yeah that's fine, I can do that.
I am trying my best here, but Docker is notoriously bad for getting the output of commands into variables that I could then use to get the project version. I have an idea for a shell workaround, I'll try it and let you know. |
Any chance you'd pick this back up @lucyydotp? |
Gonna be honest with ya I have not used this since I made this pr more than 3 years ago :’) I see no reason why the dockerfile I wrote would’ve broken though, I can pull quickly to test if wanted (edit: docker hub had some kinda controversial pricing changes in 2022, maintainers you may want to consider publishing to github’s own registry instead) |
I'm not a Docker expert, but here's a Dockerfile that seems to work fine for me. It assumes you downloaded the FROM eclipse-temurin:23-jre-alpine
RUN mkdir /opt/app
COPY Dis4IRC-1.6.3.jar /opt/app
COPY config.hocon /opt/app
WORKDIR /opt/app
CMD ["java", "-jar", "Dis4IRC-1.6.3.jar"] It's based on the docs from https://hub.docker.com/_/eclipse-temurin/, see there for many, many more options. In particular, if you want to do anything fancier, you might want the normal |
Adds a Dockerfile to allow running Dis4IRC in a Docker container. I'm more than happy to publish this on docker hub when it's finished.
To use, clone the repo,
docker build .
thendocker run -v /path/to/dir/containing/config:/srv/config <container id>
.Fixes #55