Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

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 | 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 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><project id>/ftb

$ sudo gcloud docker push<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<your project id>/ftb

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