Generic Java Docker


Recommended Posts

I am hoping what I need already exists, if not, I am willing to try building it.  But I figured it would be better to ask here first.

 

I am looking for a docker that simply runs Java, you supply it a command via the variables and it executes that at startup.  Specifically I am trying to setup running a minecraft mod server in a docker container.  But it would be super nice to have java in the docker, and everything else is mapped.  

That way I can supply a command like "-Xmx2048M -Xms2048M -jar bin/pw/prok/KCauldron/1.7.10-1614.201/KCauldron-1.7.10-1614.201.jar nogui" and don't have to make a docker specific to the mod I want to run.  

Link to comment

Please excuse my ignorance here.  I found and installed the OpenJDK docker via community applications like you recommended.  When I try to start it, it immediately exits.  Is that docker meant to be built upon, not run necessarily?  If so, do you have any recommendations for articles that go over the basics of building a docker image?

 

Thanks for all the help!

Link to comment

I got it working with the OpenJDK docker.  In case someone else has the same question here is what I did:

 

I went into the options for Community Applications and enabled the ability to search the docker repositories.

I then searched for "OpenJDK" and selected the official OpenJDK docker.

 

In the configuration screen for the container I did the following:

 

I added a path that points to the root of where I have my java assets. and named it /minecraft within the container.

I then altered the Repository field to the following (without quotes) "-w /minecraft openjdk:8 java  -Xmx4096M -Xms2048M -jar /minecraft/bin/pw/prok/KCauldron/1.7.10-1614.201/KCauldron-1.7.10-1614.201.jar nogui"

After that it was a matter of mapping the ports I needed.

 

This is probably NOT the correct way to do it, if someone has a better way please let me know.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.