Category: Data, github

One of the simplest examples that people have used over the years of demoing Docker is quickly standing up and running a Minecraft server. The first thing I decided to do was to check out the existing Docker Images for Minecraft servers to see if there were any that looked good to use, to do this I went to Docker Hub and searched for minecraft: I liked the look of minecraft-server repo, so I clicked through to have a look at the image and link through to the Github repo. To start I decide to just test out running this locally on my machine with the ‘simple get started’ Docker Run command: In the Docker Desktop Dashboard, I can see I have the container running and check the server logs to make sure everything has been initialized properly: If I load up Minecraft I can connect to my server using local host and my open port: From there, I can try to deploy this in Azure to just get my basic server running in the cloud. With the Docker ACI integration, I can log into Azure using: Once logged in, I can create a context that will let me deploy containers to an Azure resource group (this proposes to create a new azure resource group or use an existing one): I can then use this new context : I will now try to deploy my minecraft server using the exact same command I ran previously locally : Listing my azure containers, I’ll see the public IP that has been provided for my Minecraft server: However, if I follow the logs of the ACI container, the server seems to be stuck in the initialization, and I cannot connect to it from Minecraft.

To do this I need to know what folder has the Minecraft data in the Docker image, if I go and inspect our running container in the Docker Dashboard I can see that it is the /Data directory: If I wanted to add this back in my command line I would need to extend my command with something like: I can add this under the volumes in my Compose file: Now when I do a docker compose up and come back to inspect I can see the /data folder in the container is now mounted to my local folder as expected.

Related Articles