Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ world/players
world/whitelist.sqlite
world/world/stats/Pixowl.json
goproxy/goproxy
dockercraft
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
FROM golang:1.5.1
FROM golang:1.6

ENV DOCKER_VERSION 1.11.1

# Copy latest docker client(s)
COPY ./docker/docker-1.9.1 /bin/docker-1.9.1
RUN chmod +x /bin/docker-*
RUN curl -sSL -o docker.tgz https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz &&\
tar -xvf docker.tgz --strip-components=1 -C /bin && rm docker.tgz &&\
chmod +x /bin/docker-* &&\
ln -s /bin/docker /bin/docker-${DOCKER_VERSION}

# Copy Go code and install applications
COPY ./go /go
RUN cd /go/src/goproxy; go install
RUN cd /go/src/gosetup; go install
WORKDIR /go/src/github.com/docker/dockercraft
COPY . .
RUN go install

# Download Cuberite server (Minecraft C++ server)
# and load up a special empty world for Dockercraft
WORKDIR /srv
RUN sh -c "$(wget -qO - https://raw.githubusercontent.com/cuberite/cuberite/master/easyinstall.sh)" && mv Server cuberite_server
RUN ln -s /srv/cuberite_server/Cuberite /usr/bin/cuberite
COPY ./world world
COPY ./docs/img/logo64x64.png logo.png

COPY ./start.sh start.sh
CMD ["/bin/bash","/srv/start.sh"]
ENTRYPOINT ["/go/bin/dockercraft", "-daemon"]
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.PHONY: all test test-local install-deps lint fmt vet build serve

REPO_NAME = dockercraft
REPO_OWNER = docker
PKG_NAME = github.com/${REPO_OWNER}/${REPO_NAME}
IMAGE = golang:1.6
IMAGE_NAME = dockercraft-dev
CONTAINER_NAME = dockercraft-dev-container

all: test build

test-local: install-deps fmt lint vet
@echo "+ $@"
@go test -v .
test:
@docker run -v ${shell pwd}:/go/src/${PKG_NAME} -w /go/src/${PKG_NAME} ${IMAGE} make test-local

install-deps:
@echo "+ $@"
@go get -u github.com/golang/lint/golint
@apt-get -qq update && apt-get -qq -y install lua5.1

lint:
@echo "+ $@"
@test -z "$$(golint ./... | grep -v vendor/ | tee /dev/stderr)"

fmt:
@echo "+ $@"
@test -z "$$(gofmt -s -l . | grep -v vendor/ | tee /dev/stderr)"
@luac -p ./world/Plugins/Docker/*.lua

vet:
@echo "+ $@"
@go vet .

build:
@echo "+ $@"
@docker build -t ${IMAGE_NAME} .

serve:
@docker run -it --rm \
--name ${CONTAINER_NAME} \
-p 8080:8080 \
-p 25566:25565 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /Users/$$USER/.docker/machine:/root/.docker/machine \
${IMAGE_NAME} -debug
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ A simple Minecraft Docker client, to visualize and manage Docker containers.
gaetan/dockercraft
```

Mounting `/var/run/docker.sock` inside the container is necessary to send requests to the Docker remote API.
You must mount one or both of the following:

- `/var/run/docker.sock` for a local docker instance
- `~/.docker/machine/machines` for your docker machines!

Please do not mount BOTH where `/var/run/docker.sock` is located on a machine managed by docker machine.
Bad things may happen! In this case there will be a "local" and "<machine_name>" world both subscribed to
events from the same daemon.

The default port for a Minecraft server is *25565*, if you prefer a different one: `-p <port>:25565`

Expand All @@ -62,11 +69,25 @@ A simple Minecraft Docker client, to visualize and manage Docker containers.

![Dockercraft](../master/docs/img/landscape.png?raw=true)

## (Experimental) Docker Machine support

If you mount the `~/.docker/machine/machines` directory, Dockercraft will attempt to manage your machines for you. This has only been tested with Docker Machine version 0.7.0.

When you log in, you will be placed in the default world. The criteria for selecting this are as follows:

- `local` world if you've also mounted `/var/run/docker.sock`
- `default` world if you have a machine called `default`
- the first world discovered by docker-machine in alphabetical order

To view all available worlds, use the `/worlds` command from within your minecraft client

To portal to another world, `/portal <world>`.
For example, to portal to the default world I would `/portal default`

## Upcoming features

This is just the beginning for Dockercraft! We should be able to support a lot more Docker features like:

- List [Docker Machines](https://docs.docker.com/machine/) and use portals to see what's inside
- Support more Docker commands
- Display [logs](https://docs.docker.com/v1.8/reference/commandline/logs/) (for each container, pushing a simple button)
- Represent links
Expand Down
12 changes: 12 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
machine:
services:
- docker

dependencies:
override:
- echo "Nothing to see here.."

test:
override:
- make test
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ dockercraft:
build: .
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/Users/dave/.docker/machine:/root/.docker/machine"
ports:
- "25565:25565"
tty: true
tty: true
stdin_open: true
Binary file removed docker/docker-1.9.1
Binary file not shown.
1 change: 0 additions & 1 deletion go/src/github.com/Sirupsen/logrus/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions go/src/github.com/Sirupsen/logrus/.travis.yml

This file was deleted.

53 changes: 0 additions & 53 deletions go/src/github.com/Sirupsen/logrus/CHANGELOG.md

This file was deleted.

Loading