2. Before we start...
I’m still learning Java and Minecraft modding, so any feedback would be
appreciated. I would love to receive any of the following:
● Code review
● Pull requests
● Issues
● Testing in your environment
○ Maybe find bugs and file issues for them
GitHub repository: www.github.com/AdityaGupta1/mobycraft
3. What does it do?
● Manage Docker containers using Minecraft
● Run some Docker commands from the game, as well as some new
convenience commands
● Add features (new blocks, items, commands, etc.) that simplify container
management
● Runs from a Java development environment
○ Easy to debug and test new features
■ Also easy to contribute to the project
○ Could possibly be used to teach Docker concepts to Minecrafters
4. Visualizing containers
● Each container is built as a 5x5x7 box with two buttons inside and two signs
outside
○ Buttons can start/stop container and show detailed information about container
○ Signs say container name and image
● Different look depending on whether container is started or stopped
○ Gray for running, red for stopped
● Container Wand for interacting with containers
○ Right click on a container’s name sign to remove the container
● Automatic container building at a specified rate
5. Docker commands in Minecraft
● Many common Docker commands (ps, run, etc.) are part of this mod
● Convenience commands like /docker kill_all (kills all containers) and
/docker rm_stopped (removes all stopped containers)
● /docker help for in-game help about commands
● Helpful commands like /docker heat_map
6. Fun Stuff
Moby the 3D Minecraft whale mascot -
custom 3D model and texture
Open source - github.
com/AdityaGupta1/mobycraft
7.
8. What I learned from this project
● Basic Docker terminology
○ Container - An application packaged up and wrapped in a nice bow so it is easy to download
and run
○ Docker client, host, and hub - Docker CLI (client) uses REST API to talk to the Docker
Machine (host), which gets containers and images from the hub
○ Docker Machine - A host for containers and the Linux virtual machine they run on
○ `docker ps` - A command that lists the containers on the current Docker machine and
information about them (image, ID, status, etc.)
○ `--help` and docs.docker.com - Where to go when you need help with Docker
○ Docker Swarm - A bunch of Docker Machines that share the job of container hosting
9. What I learned from this project
● Some Java skills
○ Access modifiers - public, private, protected, etc.
○ continue; and break; statements
● Design patterns
○ DRY - Don’t Repeat Yourself
■ e.g. merging two if loops with the same conditional statement
● Shading JARs in Gradle
● Asynchronous callbacks
○ e.g. StatisticsResultCallback class
10. Why is the CLI faster than the Java API?
Minecraft
Minecraft Forge
Docker-Java
JVM
Docker host
MobycraftCommand Line Interface
CLI
Docker host
● The bigger the stack of
pancakes is, the longer it
takes to eat it
● The more layers that you
go through before
sending the REST call to
the Docker host, the
longer it takes
11. Upcoming features
● Docker Swarm cluster visualization and management (#21)
○ Waiting for docker-java to add Swarm support in a future version
● Packaged JAR file for running in Minecraft (#38)
○ Currently only runs from a development environment or really laggy from release Minecraft
● Show containers from a multi-cloud Docker Swarm cluster (#8)
● Add more modes to Container Wand (#53)
12. How you can help
● Code review
● Pull requests
● Issues
● Testing in your environment
○ Maybe find bugs and file issues for them
GitHub repository: www.github.com/AdityaGupta1/mobycraft