


After some minutes, Docker should have finished bulding the image successfully. This command tells the Docker daemon to build a Docker Image tagged as minetest/server with version latest based on the directory containing the Dockerfile (in this case the current one, indicated using a single dot). cd into the directory and run the following: $ docker build -t minetest/server:latest. This reduces the overhead sent to the Docker daemon, since the docker build command sends the whole directory to it. Make sure that your Dockerfile is in an empty directory. Now that we have a Dockerfile, we can build the corresponding Docker image using the docker build command. In our case, it’s empty, but it’s useful if you have multiple worlds in your world directory, so you can add the -worldname argument to it when starting your container. Add an ENTRYPOINT line to the Dockerfile:ĭid you notice this last CMD line? CMD can provide a default list of arguments to the ENTRYPOINT. Surprisingly, that’s our Minetest server. It’s important to add the /udp suffix to make sure Docker maps a UDP port instead of a TCP port.įinally, when just need to tell Docker which application should be started, when the container starts up. We also need to expose the server’s port - 30000 by default - to the outside world.
#Minetest maps update
games (we might want to add, remove or update certain subgames without building a new image) Let’s start by collecting the important files and directories that need to persist, relative to our Minetest directory: To do this, Docker can create volumes, which map directories from the host to container. For a Minetest server, you usually don’t want this, so we need to tell Docker to store the important data somewhere persistent: the host machine. This means that you lose all data gathered during runtime. Great! We should now be able to build a Minetest server! But we’re not done yet! Persisting worlds, subgames and modsĮvery time you start a new container, it’s initial state equals its image. Let’s tell cmake to build a run in place server: If you need a specific version, be sure to change the URL and the filenames.Įventually it’s time to compile our server. Now we need to download the source code and the default subgame minetest_game.
#Minetest maps install
Next, we need to install the Minetest dependencies, as listed in Minetest’s README.

Of course, you can also use other images, like Alpine, but the dependencies might be a little different. We’ll use the latest Ubuntu image to stay as close to the official documentation as possible. It contains your application and serves as the model from which your container is created. Creating the DockerfileĮvery Docker Container needs an image to run from. Please follow the instructions on to install Docker on your OS.
#Minetest maps how to
In this first article, I’ll show you how to dockerize the Minetest server. when using PostgreSQL as database backend and sofar’s Minetest Media Server for media delivery. Please note: This article was migrated from the old websiteĭockerizing Minetest makes hosting a Minetest server much easier than it used to be, especially when it comes to more complicated setups, e.g.
