Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
CheckEula.sh
Dockerfile
README.md

README.md

Running a Minecraft server on Google Compute Engine with Docker

This repository accompanies the Running a Minecraft server on Google Compute Engine with Docker blog entry, published on 29 June 2015. Please follow along in the blog entry, as it provides context and explanation for this repository's contents. Files and commands may require updating as future versions of docker and gcloud are released.

Set up

Executed on local machine:

$ curl https://sdk.cloud.google.com | bash

$ gcloud auth login

$ glcoud compute ssh minecraft-docker --zone  us-central1-f

Create and build Minecraft container

Executed on development environment:

$ sudo gcloud components update

$ sudo docker ps

Create Dockerfile and CheckEula.sh on development environment.

Executed in the directory with created files.

$ sudo docker build -t <docker user>/ftb .

$ sudo docker images

$ sudo docker tag <image id> gcr.io/<project id>/ftb

$ sudo gcloud docker push gcr.io/<project id>/ftb

Create server instance and run container

Executed on local machine:

$ gcloud compute firewall-rules create minecraft-port \
		--description "Allow connecting over port 25565" \
        --allow tcp:25565

$ gcloud compute instances create minecraft-server \
		--image container-vm \
		--zone  us-central1-f \
		--machine-type n1-standard-1
		--scopes storage-rw

$ gcloud compute instances list

$ gcloud compute ssh minecraft-server

Executed on minecraft-server:

$ sudo gcloud components update

$ sudo gcloud docker pull gcr.io/<your project id>/ftb

$ sudo docker run -p 25565:25565 -e EULA=true -d gcr.io/<your project id>/ftb