repos
/ docker-minecraft master

docker-minecraft

mirror archived upstream

An easy way to get a Minecraft server up and running using Docker.

dockergame-serverhandcodedminecraftminecraft-servershell

1.9 KB · 52 lines · markdown Raw History
 1> **Archived.** This project is no longer in use and no longer maintained. Last updated January 2017.
 2
 3# docker-minecraft
 4
 5A nice and easy way to get a Minecraft server up and running using docker. For
 6help on getting started with docker see the [official getting started guide][0].
 7For more information on Minecraft and check out it's [website][1].
 8
 9
10## Building docker-minecraft
11
12Running this will build you a docker image with the latest version of both
13docker-minecraft and Minecraft itself.
14
15    git clone https://github.com/overshard/docker-minecraft
16    cd docker-minecraft
17    sudo docker build -t overshard/minecraft .
18
19
20## Running docker-minecraft
21
22Running the first time will set your port to a static port of your choice so
23that you can easily map a proxy to. If this is the only thing running on your
24system you can map the port to 25565 and no proxy is needed. i.e.
25`-p=25565:25565` . If you want to enable the query protocol you need
26to add another -p=25565:25565/udp to forward the UDP protocol on the
27same port as well.
28Also be sure your mounted directory on your host machine is
29already created before running `mkdir -p /mnt/minecraft`.
30
31    sudo docker run -d=true -p=25565:25565 -v=/mnt/minecraft:/data overshard/minecraft /start
32
33From now on when you start/stop docker-minecraft you should use the container id
34with the following commands. To get your container id, after you initial run
35type `sudo docker ps` and it will show up on the left side followed by the
36image name which is `overshard/minecraft:latest`.
37
38    sudo docker start <container_id>
39    sudo docker stop <container_id>
40
41
42### Notes on the run command
43
44 + `-v` is the volume you are mounting `-v=host_dir:docker_dir`
45 + `overshard/minecraft` is simply what I called my docker build of this image
46 + `-d=true` allows this to run cleanly as a daemon, remove for debugging
47 + `-p` is the port it connects to, `-p=host_port:docker_port`
48
49
50[0]: http://www.docker.io/gettingstarted/
51[1]: http://minecraft.net/