This is your ultimate docker container for running minecraft 1.7.10+ in any forms available, not wasting your resources.
- Check your desired server software is compatible with 1.7.10+
- Install docker on your host: (Ref)
- Dont forget to accept the eula and configure everything, including the memory limit!
- The port of your server software must listen on port 25565, this is the default.
- Copy paste the sample docker-compose file
Mount your server folder unter /srv/mcsrvod/
and rename your jar file to server.jar
.
The container will start the attached jar file when an connection to port 3000 is etablished. This is the public port for minecraft, you can change the outside mapping to whatever you like.
- This docker image is only suitable for minecraft 1.7.10+
- The log is not directly visible in docker logs, it must be read from the according file, due to independence of the server software
You can specify the interval in seconds the server should shutdown than no one is online. To do so specify the environment variable KILL_INTERVAL
You can customize the jvm start arguments via an envrionment variable called JAVA_OPTS
. Same goes for your server arguments, to specify them simply set the env for SERVER_OPTS
Please check if the eula.txt is created and its agreement is set, this must be done by yourself.
The server may need some time to completely start, till that you will see an long running poll. For normal installations this is normally not that long, depending on your machine power. For modpacks this may take some time.
version: '2.4'
services:
hobbyMinecraftServer:
image: timoreymann/mcsrvod:latest
restart: always
ports:
# map to default port
- 25565:3000
environment:
# Set some max memory args
- JAVA_OPTS=-Xms256M -Xmx1128M -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
# we dont want a console in there
- SERVER_OPTS=nogui --noconsole
- KILL_INTERVAL=900
volumes:
# Mount the folder with the server.jar and stuff
- ./minecraft:/srv/mcsrvod
# we dont want to waste our servers resources ;)
mem_limit: 1200M