Uploaded May 2025 | Updated November 2026, 3 hours ago
Lets expand the dockerized Mindustry server we've been building by dynamically downloading the `server.jar` when we build our image and enabling custom maps, automatic hosting, persistent save files and more! We'll be taking a look at how we can use volumes to mount local directories in our container so we're able to add custom maps or access our servers config files locally. Then we'll look at using scripts that can automatically start our server using the custom map file we choose when starting our server.
Our expanded Dockerfile looks like this:
```dockerfile
FROM openjdk:25-slim
ARG MINDUSTRY_VERSION
ENV MINDUSTRY_VERSION=${MINDUSTRY_VERSION:-"v146"}
COPY run-server.sh /mindustry/run-server.sh
ADD github.com/Anuken/Mindustry/releases/download/$MINDUSTRY_VERSION/server-release.jar /mindustry/server.jar
CMD [ "sh", "/mindustry/run-server.sh" ]
```
`ADD` lets us add remote files to our container image, this means we can directly link to the github release binaries to add them to the image without having to download them to our computer first.
Our `run-server.sh` script hosts a random map or the map provided in the `MINDUSTRY_MAP` environment variable if you provide it.
```sh
if [ -z "${MINDUSTRY_MAP}" ]; then
java -jar /mindustry/server.jar host
else
java -jar /mindustry/server.jar host $MINDUSTRY_MAP
fi
```
Once we have created those two files, we are able to build our server using `docker build`:
```sh
docker build --tag "mindustry-server" --build-arg MINDUSTRY_VERSION="v146" .
```
This builds our `mindustry-server` image with the `MINDUSTRY_VERSION` version of Mindustry - in this case `v146`.
Once we have both of these scripts we can run our server using:
```sh
docker run -it -p 6567:6567 -p 6567:6567/udp -v ${pwd}/config:/config -v ${pwd}/maps:/config/maps -e MINDUSTRY_MAP="Veins" mindustry-server
```
This command runs a new `Veins` map including our maps and config settings for persistence using volumes.
The current version of this container is available on GitHub at github.com/WorldOfZero/mindustry-server
***
Mindustry is available on Itch or Steam for desktop players or you can get a copy for your mobile phones:
* Itch.io: anuke.itch.io/mindustry
* Steam: store.steampowered.com/app/1127400/Mindustry
* Google Play Store (Android): play.google.com/store/apps/details?id=io.anuke.mindustry&pli=1
* Apple App Store (iOS): apps.apple.com/us/app/mindustry/id1385258906?ls=1
(I don't have any association with this game, I just like playing it)
***
If you missed the first video in our Dockerized Mindustry Server, you can catch up here: youtu.be/m3mowhqXsXE
Lets expand the dockerized Mindustry server we've been building by dynamically downloading the `server.jar` when we build our image and enabling custom maps, automatic hosting, persistent save files and more! We'll be taking a look at how we can use volumes to mount local directories in our container so we're able to add custom maps or access our servers config files locally. Then we'll look at using scripts that can automatically start our server using the custom map file we choose when starting our server.
Our expanded Dockerfile looks like this:
```dockerfile
FROM openjdk:25-slim
ARG MINDUSTRY_VERSION
ENV MINDUSTRY_VERSION=${MINDUSTRY_VERSION:-"v146"}
COPY run-server.sh /mindustry/run-server.sh
ADD github.com/Anuken/Mindustry/releases/download/$MINDUSTRY_VERSION/server-release.jar /mindustry/server.jar
CMD [ "sh", "/mindustry/run-server.sh" ]
```
`ADD` lets us add remote files to our container image, this means we can directly link to the github release binaries to add them to the image without having to download them to our computer first.
Our `run-server.sh` script hosts a random map or the map provided in the `MINDUSTRY_MAP` environment variable if you provide it.
```sh
if [ -z "${MINDUSTRY_MAP}" ]; then
java -jar /mindustry/server.jar host
else
java -jar /mindustry/server.jar host $MINDUSTRY_MAP
fi
```
Once we have created those two files, we are able to build our server using `docker build`:
```sh
docker build --tag "mindustry-server" --build-arg MINDUSTRY_VERSION="v146" .
```
This builds our `mindustry-server` image with the `MINDUSTRY_VERSION` version of Mindustry - in this case `v146`.
Once we have both of these scripts we can run our server using:
```sh
docker run -it -p 6567:6567 -p 6567:6567/udp -v ${pwd}/config:/config -v ${pwd}/maps:/config/maps -e MINDUSTRY_MAP="Veins" mindustry-server
```
This command runs a new `Veins` map including our maps and config settings for persistence using volumes.
The current version of this container is available on GitHub at github.com/WorldOfZero/mindustry-server
***
Mindustry is available on Itch or Steam for desktop players or you can get a copy for your mobile phones:
* Itch.io: anuke.itch.io/mindustry
* Steam: store.steampowered.com/app/1127400/Mindustry
* Google Play Store (Android): play.google.com/store/apps/details?id=io.anuke.mindustry&pli=1
* Apple App Store (iOS): apps.apple.com/us/app/mindustry/id1385258906?ls=1
(I don't have any association with this game, I just like playing it)
***
If you missed the first video in our Dockerized Mindustry Server, you can catch up here: youtu.be/m3mowhqXsXE






![Pseudo-Random Colors with Hashed Strings
In this video were going to explore a way I approach reproducible pseudo-random number generation that uses calculated hashes to select a random item or property for an object. In this case well be assigning hue shifted colors to text strings. This helps easily identify elements in a list by searching for both a memorable name but also a color that will always be the same for a similar string.
To convert a string into an integer using an `MD5` hash you could write something like this:
```csharp
var stringToHash = World of Zero;
var hasher = MD5.Create();
var hash = hasher.ComputeHash(Encoding.UTF8.GetBytes(stringToHash));
var hashedInteger = BitConverter.ToInt32(hash, 0);
```
Then to convert an integer into a random color use this. In this example 256 hues will be selected from the color wheel:
```csharp
var color = Color.HSVToRGB((Math.Abs(hashedInteger) % 256) / 256.0f, 1.0f, 0.75f);
```
This same technique can be applied to other things as well. For example we can use the hashed value to index into a lookup table of names. Other approaches could apply a specific texture to a material or instantiate a specific prefab:
```csharp
var potentialNames = new string[] { World of Zero, YouTube, Unity 3D };
var name = potentialNames[Math.Abs(hashedInteger) % potentialNames.Count];
```
The `System.Security.Cryptography.MD5` class is documented here: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.md5
More information on how hashes work on Wikipedia: https://en.wikipedia.org/wiki/Hash_function
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Pseudo-Random Colors with Hashed Strings](https://i.ytimg.com/vi/BHtKrZSuZMk/mqdefault.jpg)

. This gives us a bit more freedom to build something fast and responsive with a more suited UI. The backend is a custom ASP.NET server which makes calls to the YouTube API services to retrieve videos.
Theres a few fun new features Ive added here as well that Im excited to expand on in the future.
1. The descriptions support Markdown! This means that we get very pretty descriptions and...
2. Syntax Highlighting! As part of the Markdown support we also are able to add syntax highlighting so languages are displayed in what I hope is a very readable way.
Three examples of this are csharp, java and shader highlighting:
```csharp
var test = Hello, beta.worldofzero.com!;
```
```java
String test = Hello, beta.worldofzero.com!;
```
```shader
float3 = float3(42.0, 9001.0, 3.14159);
```
All languages are distinguished by a unique color and a link to Learn More which Ive tried to link to an online sandbox for that language (try.dot.net in the case of C# and shadertoy.com in the case of shaders). This feature is pretty experimental at this point so Id love to hear your feedback on it!
There are a lot of ways we could improve this more and Id love to get your feedback on what works, what could use more work and cool new features you think would make it even better!
You can checkout the new World of Zero website at http://worldofzero.com
If you want to checkout the code for this new website you can head to: https://github.com/WorldOfZero/dotcom.
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u I Built A New Website](https://i.ytimg.com/vi/BnhiqddQpVo/mqdefault.jpg)

