Giter Site home page Giter Site logo

itzg / docker-minecraft-server Goto Github PK

View Code? Open in Web Editor NEW
8.4K 64.0 1.4K 3.75 MB

Docker image that provides a Minecraft Server that will automatically download selected version at startup

Home Page: https://docker-minecraft-server.readthedocs.io/

License: Apache License 2.0

Shell 96.72% Dockerfile 2.46% Mermaid 0.82%
minecraft-server dockerfiles docker-image hacktoberfest

docker-minecraft-server's Introduction

docker-minecraft-server's People

Contributors

aitor-binaryshock avatar camalot avatar crazymanjinn avatar danpolanco avatar dependabot[bot] avatar dudymas avatar ikke-t avatar itzg avatar jawa-juice avatar jimtremblay avatar jtcressy avatar macman31 avatar megasware128 avatar noahimesaka1873 avatar oekn5w avatar orblazer avatar p4sca1 avatar rampd2 avatar rhullah avatar sconaway avatar scones avatar shotah avatar silthus avatar sshipway avatar stealthii avatar stonelabs avatar terminalfault avatar trikolon avatar vorburger avatar wlp7s0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-minecraft-server's Issues

unable to execute /start-minecraft: Text file busy?

When running the latest itzg/minecraft-server image (Image ID: 61f744a5eaa6) on VirtualBox, I get the following error.

$ docker images itzg/minecraft-server
REPOSITORY              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
itzg/minecraft-server   latest              61f744a5eaa6        2 hours ago         399.3 MB

$ docker run --detach --interactive --tty \
>   --name minecraft-whitelist \
>   -e VERSION=LATEST \
>   -e OPS=user1 \
>   -e WHITELIST=user1,user2,user3,user4 \
>   -e EULA=TRUE \
>   -e MOTD="VirtualBox World" \
>   -p 25565:25565 \
>   itzg/minecraft-server
e997fef2bb9b684e1220eeff716d1277255082f56363170fdefdf110da843b05

$ docker ps -a
CONTAINER ID        IMAGE                   COMMAND             CREATED             STATUS                      PORTS               NAMES
e997fef2bb9b        itzg/minecraft-server   "/start"            14 seconds ago      Exited (1) 14 seconds ago                       minecraft-whitelist

$ docker logs minecraft-whitelist
usermod: no changes
sudo: unable to execute /start-minecraft: Text file busy

However if I run it in another environment, such as Carina. It works.

$ docker images itzg/minecraft-server
REPOSITORY              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
itzg/minecraft-server   latest              61f744a5eaa6        2 hours ago         399.3 MB

$ docker run --detach --interactive --tty \
>   --name minecraft-whitelist \
>   -e VERSION=LATEST \
>   -e OPS=user1 \
>   -e WHITELIST=user1,user2,user3,user4 \
>   -e EULA=TRUE \
>   -e MOTD="Carina World" \
>   -p 25565:25565 \
>   itzg/minecraft-server
8aaf17d6bd83c101c3e8ac6989de95247df59049df02e244e5e92041643ce64d

$ docker ps
CONTAINER ID        IMAGE                   COMMAND             CREATED             STATUS              PORTS                           NAMES
8aaf17d6bd83        itzg/minecraft-server   "/start"            28 seconds ago      Up 27 seconds       xxx.xxx.xxx.xxx:25565->25565/tcp   0dc4a907-960c-4c1b-9f07-cd9071fb87b1-n1/minecraft-whitelist

$ docker attach minecraft-whitelist
/whitelist list
[17:44:59] [Server thread/INFO]: There are 4 (out of 0 seen) whitelisted players:
[17:44:59] [Server thread/INFO]: user1, user2, user3 and user4

@itzg Can you please try it locally/VirtualBox?

I'd hate to think I borked your image with #46. If it works for you, feel free to just close this.

[minecraft] Setting up GID and umask

I've been making some modifications to the scripts because I'd like to make sure the container is deployed with a specific GID -- that way I can put the minecraft admins (outside the container) inside of a group that has write access to "/data"

So I added this to start.sh,

 set -e
 usermod --uid $UID minecraft
-chown -R minecraft /data /start-minecraft
+
+if [ -n "$GID" ]
+then
+    # Patch the GID to what we specified.
+    groupmod --gid $GID minecraft
+fi
+
+# Make group writable if we've specified a specific GID
+if [ -n "$GID" ]
+then
+    chown -R minecraft:$GID /data /start-minecraft
+    chmod -R g+wX /data /start-minecraft
+    umask 002
+else
+    chown -R minecraft /data /start-minecraft
+    umask 022
+fi

But the umask also needs to be done in start-minecraft.sh,

 #!/bin/bash

+if [ -n "$GID" ]
+then
+    umask 002
+else
+    umask 022
+fi
+
 if [ ! -e /data/eula.txt ]; then

I was going to do a pull request, but I wonder if I should actually just do another environment variable for UMASK rather than checking whether GID is set. I'm ok with the way it is, but if you want my code, I can write it the way you'd like to see it.

This also may require some reordering and changes in Dockerfile...

[cassandra] Move mainline to 2.1.x

Since the main page now states

The most stable release of Apache Cassandra is 2.1.7 (released on 2015-06-22). If you are looking for latest production ready Cassandra, download this one.

apache-cassandra-2.1.7-bin.tar.gz

Need to leave a 2.0.x branch and Docker tag for continued support of those versions.

minecraft-server: Issues with player disconnect?

I was wondering if anyone else has had a problem with player disconnects using this docker image.

It seems to be solved by setting --net host in the run command, but I'm unsure why that would be an issue.

Anyone else see that?

su: System error

Hi,
I'm starting a container with your dockerfile,

I keep getting this:

azureuser@blastercraft:~$ sudo docker run -d -it --name mc -e EULA=TRUE -p 25565:25565 -v /opt/craft/:/data itzg/minecraft-server
2e021c0aac782c28e9a78189164f06aa85d91a97086f6ed193f493adcb2f033b
azureuser@blastercraft:~$ sudo docker logs mc
usermod: no changes
su: System error
azureuser@blastercraft:~$

What the heck? :-/ Why is it working for everyone but me? .-. (as I can see...)

elastic search volume /data issue to host

Hi

I am trying to use the elastic search docker image with volumised the /data container data to host /data for persistent storage.

something like this:
docker run -d -p 9200:9200 -p 9300:9300 -v /es/data:/data itzg/elasticsearch
but it throwing issues and docker image getting Exited in few ms.

if you don't volume its working correctly. but i can't able to persist the data.

Is i am running correct command? or missing something.

cannot stop/start or restart container if /data volume is mounted

I happen to be running with TYPE=BUKKIT, but this probably happens with other types as well.

I'm mounting /data volume. I expect to be able to stop the container, and start the container. However, the subsequent start container causes

usermod: no changes
mkdir: cannot create directory '/home/minecraft': File exists.

As a workaround, I found that I can "clear" the container, and then the start command will work again.

obviously I'm trying to not loose my data directory, and the resulting customizations...

[mc] Using TYPE=FORGE does not identify 1.8 Forge version

$ docker run -it -p 25565:25565 -e EULA=TRUE -e TYPE=FORGE  itzg/minecraft-server
usermod: no changes
Checking version information.
--2015-05-31 14:52:24--  https://s3.amazonaws.com/Minecraft.Download/versions/versions.json
Resolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.12.184
Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.12.184|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20645 (20K) [application/octet-stream]
Saving to: 'STDOUT'

100%[==========================================================================>] 20,645      --.-K/s   in 0.05s

2015-05-31 14:52:25 (415 KB/s) - written to stdout [20645/20645]

Checking minecraft / forge type information.
Checking Forge version information.
Downloading forge-1.8--installer.jar ...
Installing forge-1.8--universal.jar
Error: Unable to access jarfile forge-1.8--installer.jar
Error: Unable to access jarfile forge-1.8--universal.jar

1.9 release causes incorrect forge file to be called

forge-1.9-11.15.1.1722-universal.jar should be forge-1.8.9-11.15.1.1722-universal.jar. For prosperity, @itzg created a ComparableVersions for that reason and it just needs to be altered to fix this.

I believe the shell script just needs to be updated.

[summarized from Slack chat]

[feature] [minecraft-server] Allow passing of world data to server

The minecraft-server container is very flexible, but one thing missing is the ability to pas a preexisting world without having to manage the storage.

It would be good to be able to pass -e WORLD=url and have the container download a zipfile from the specified URL and unpack it into the /data/world directory. This would allow using ephemeral copies of archived worlds (eg, Hunger Games worlds) that would be copied, and then deleted after the server exited. You could also use this in multiple instances then without needing multiple storage.

Should be pretty simple to do, if nobody else does it, I might make a pull req later...

[minecraft-server] Support server mounts for minecraft data

I'm running your minecraft image with server mounts for the data. Much easier to ensure I don't accidentally delete data by deleting a data container.

However, it is tricky to do this with the support for running as a non-root user. The UID used from within the image isn't documented. Because of this, you need to chown the data directory before starting up the container to some unknown UID.

I was working around this by starting the container as root (-u 0) and running /start. The /start script was fixing the file permissions on the volume and then starting the server as the minecraft user.

This broke today when you removed the /start command from the image.

Options to fix it:

  • Add /start back in and rename/document it.
  • Support specifying the UID to use and rewrite the /etc/passwd from within the container.

I'm happy to code and send a PR as you like but wanted to get your thoughts before doing so.

[minecraft] Error: Invalid or corrupt jarfile minecraft_server.1.9.jar

I'm trying to create a docker container based on itzg/minecraft-server. Unfortunately, starting the docker container fails with the error message Error: Invalid or corrupt jarfile minecraft_server.1.9.jar. I'm not sure if this is an issue with the image or with some kind of configuration I messed up, but I'm glad for any help. Relevant files and logs are attached:

docker-compose.yml

minecraft-server:
  ports:
    - "25565:25565"
  volumes:
    - /var/docker/minecraft/server/data:/data
  environment:
    EULA: "TRUE"
  image: itzg/minecraft-server
  container_name: mc

running docker-compose up

[admin@server server]$ sudo docker-compose up
Creating mc
Attaching to mc
mc | usermod: no changes
mc | ...switching to user 'minecraft'
mc | Checking version information.
mc | --2016-03-11 18:47:47--  https://s3.amazonaws.com/Minecraft.Download/versions/versions.json
mc | Resolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.12.248
mc | Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.12.248|:443... connected.
mc | HTTP request sent, awaiting response... 200 OK
mc | Length: 23637 (23K) [application/octet-stream]
mc | Saving to: ‘STDOUT’
mc | 
mc |      0K .......... .......... ...                             100%  249K=0.09s
mc | 
mc | 2016-03-11 18:47:48 (249 KB/s) - written to stdout [23637/23637]
mc | 
mc | Checking type information.
mc | Error: Invalid or corrupt jarfile minecraft_server.1.9.jar
mc exited with code 1

[minecraft-server] option to use forge

I'm going to try and figure this out and maybe fork and merge, but what do you think about having an argument to use a forge server? Or should that be a totally different image?

[es] Cannot install plugin with 2.0

The cmdline parameters for installing plugins have changed in ES 2.0.
The start script needs to be updated. i.e.
$ES_HOME/bin/plugin install $p

When trying to install a plugin with the current setup I am seeing errors in the docker logs like:
Installing the plugin delete-by-query
ERROR: unknown command [--install]. Use [-h] option to list available commands

Persistent data

Hello

I use your awesome Dockerfile Elasticsearch (with Marvel). The only problem is that data are not saved after docker restart (or laptop reboot)

Is there a possibility to save the data to avoid to fill Elasticsearch at every restart ?

I just read the Dockerfile, /data and /conf are not created. There needs to use sudo somewhere?

Zen discovery doesn't work

Hi,

i have tried to get the multi-node cluster working and have the problem that the nodes are not forming a cluster after

http://192.168.99.100:9200/_cluster/health?pretty

i get always

"number_of_nodes" : 1,

I'm using MacOS with docker-machine.

Any ideas?

Kind regards
Alex

minecraft-server: MOTD not overriding the server MOTD

Thanks so much for the docker container!

When I start the container like this:

docker run -d -it -p 25565:25565 --name mc -e EULA=TRUE -v ~/minecraft-data:/data -e ICON=<some-image> -e 'MOTD=An Overriden Message' itzg/minecraft-server

The ICON is overridden but the MOTD remains A Minecraft Server Powered by Docker.

Am I doing something wrong?

[minecraft] Bukkit config using Spigot case?

I'm looking through the shell script, and it is a bit confusing how it bootstraps a bukkit server. It checks for BUKKIT and then sets the TYPE to SPIGOT ...

case "$TYPE" in                                                                 
  *BUKKIT|*bukkit|SPIGOT|spigot)                                                
    TYPE=SPIGOT                                                                 
    case "$TYPE" in                                                             
      *BUKKIT|*bukkit)                                                          
        echo "Downloading latest CraftBukkit 1.8 server ..."                    
        SERVER=craftbukkit_server.jar                                           
        ;;                                                                      
      *)                                                                        
        echo "Downloading latest Spigot 1.8 server ..."                         
        SERVER=spigot_server.jar                                                
        ;;                                                                      
    esac                                                                        
    case $VANILLA_VERSION in                                                    
      1.8*)                                                                     
        URL=/spigot18/$SERVER                                                   
        ;;                                                                      
      *)                                                                        
        echo "That version of $SERVER is not available."                        
        exit 1                                                                  
      ;;                                                                        
    esac                                                                        
    wget -q https://getspigot.org$URL                                           
    ;;                                                                          

[es] Need a mechanism to override the 'docker run' provided environment variables

Sometimes it is desirable to change a node's cluster after it has been running for a while. At this point the script

https://github.com/itzg/dockerfiles/blob/master/elasticsearch/start

can only obtain values like $CLUSTER_NAME from the docker run environment variables. It would be good to have that file optionally source a file owned by the container user elasticsearch, like /conf/overrides at the start of the script.

titan-gremlin crashes on start

Execution dump:

$ docker-compose -f titan.yml run titan

         \,,,/
         (o o)
-----oOOo-(_)-oOOo-----
Apr 13, 2016 1:40:11 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
13:40:13 WARN  org.apache.hadoop.util.NativeCodeLoader  - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager
        at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55)
        at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:421)
        at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:361)
        at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1275)
        at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
        at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:61)
        at com.thinkaurelius.titan.core.TitanFactory$open.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at groovysh_evaluate.run(groovysh_evaluate:84)
        at groovysh_evaluate$run.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at groovysh_evaluate$run.call(Unknown Source)
        at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67)
        at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source)
        at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:152)
        at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.initializeShellWithScript(Console.java:105)
        at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.<init>(Console.java:73)
        at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.<init>(Console.java:91)
        at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.main(Console.java:95)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44)
        ... 20 more
Caused by: com.thinkaurelius.titan.diskstorage.TemporaryBackendException: Temporary failure in storage backend
        at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager.ensureKeyspaceExists(AstyanaxStoreManager.java:563)
        at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager.<init>(AstyanaxStoreManager.java:283)
        ... 25 more
Caused by: com.netflix.astyanax.connectionpool.exceptions.PoolTimeoutException: PoolTimeoutException: [host=172.17.0.3(172.17.0.3):9160, latency=10001(10001), attempts=1]Timed out waiting for connection
        at com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool.waitForConnection(SimpleHostConnectionPool.java:231)
        at com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool.borrowConnection(SimpleHostConnectionPool.java:198)
        at com.netflix.astyanax.connectionpool.impl.RoundRobinExecuteWithFailover.borrowConnection(RoundRobinExecuteWithFailover.java:84)
        at com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl.tryOperation(AbstractExecuteWithFailoverImpl.java:117)
        at com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:338)
        at com.netflix.astyanax.thrift.ThriftClusterImpl.executeSchemaChangeOperation(ThriftClusterImpl.java:146)
        at com.netflix.astyanax.thrift.ThriftClusterImpl.internalCreateKeyspace(ThriftClusterImpl.java:321)
        at com.netflix.astyanax.thrift.ThriftClusterImpl.addKeyspace(ThriftClusterImpl.java:294)
        at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager.ensureKeyspaceExists(AstyanaxStoreManager.java:558)
        ... 26 more

Compose file:

$ cat titan.yml 
titan:
    image: itzg/titan-gremlin
    links:
        - cass
        - es
cass:
    image: itzg/cassandra
es:
    image: itzg/elasticsearch

Trouble with Minecraft 1.8.9 Forge 11.15.1

-e VERSION=1.8.9 -e TYPE=FORGE -e FORGEVERSION=11.15.1.1722

For some reason the script is stripping off the .9 and failing to download the requested 1.8.9/forge version combo. But with the following hack,it works:

--- a/minecraft-server/start-minecraft.sh
+++ b/minecraft-server/start-minecraft.sh
@@ -65,7 +65,7 @@ case "$TYPE" in
     # norm := the official Minecraft version as Forge is tracking it. dropped the third part starting with 1.8
     TYPE=FORGE
     case $VANILLA_VERSION in
-      1.7.*)
+      *)
         norm=$VANILLA_VERSION
       ;;```

It seems *clear to me* that I want a specific known-working version combo for certain mods. 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.