This project provides a Docker image that enables the execution of a PurpurMC server on the Zulu OpenJDK platform. PurpurMC serves as an enhanced, drop-in substitute for PaperMC servers, aiming at greater flexibility and adding new, enjoyable gameplay features.
Zulu OpenJDK is a complimentary, fully compliant, and 100% open-source implementation of the Java SE Platform, Standard Edition.
Feel free to fork this repository and adapt it according to your requirements.
The choice for Zulu was influenced by a desire for exploration, as most OpenJDK implementations are quite similar. The main concern with Zulu is that it depends on a single company, Azul, which retains the right to change their license or policies at their discretion.
The following requirements are necessary to run the Docker image:
- Docker: An essential platform to deploy applications inside software containers. Check out the installation guide if not already installed.
- Docker-compose: A tool for defining and running multi-container Docker applications.
- Operating System: Preferably Linux, WSL2, or macOS.
- Architecture: The system architecture should be either amd64 or arm64.
Although I recommend using Docker Compose for its convenience and utility, you can opt for the Docker CLI if you prefer.
Remember to replace the PUID
and PGID
environment variables to operate as a non-root user.
Here's a sample docker-compose.yml
configuration for the project:
version: "3.9"
services:
minecraft:
container_name: "mcserver"
image: "als3bas/zulu-purpurmc:latest"
restart: unless-stopped
environment:
- MEMORYSIZE: "1G"
- PUID: "xxxx"
- PGID: "xxxx"
- PAPERMC_FLAGS: ""
- PURPURMC_FLAGS: ""
volumes:
- ./:/data:rw
ports:
- "25565:25565"
stdin_open: true
tty: true
For security reasons, it's recommended to run the server as a non-root user. You can achieve this by setting the PUID
and PGID
environment variables to match the user and group ID of the chosen non-root user.
To retrieve these values, use the following command:
id $USER
Output: uid=1000(alvaro) gid=984(users) groups=984(users),998(wheel),973(docker)
In this example, 'alvaro' is the user with ID 1000
and 'users' is the group with ID 984
.
environment:
- PUID=1000
- PGID=984
Run the server with the following command:
docker-compose up -d --build
Stop the server with the following command:
docker-compose stop
To see the logs of the server, run the following command:
docker-compose logs -f
You can leverage the Makefile provided in this repository for common operations. Here's a brief overview of what you can do:
make start
make stop
make down
Useful for updating the PurpurMC version. Your world, plugins, or configuration files are safe.
make build
Useful for refreshing configuration or plugin files.
make restart
Allows you to execute server commands like /op
, /reload
, etc. Remember to use CTRL + P + Q
to detach from the console without stopping the server.
make attach
make logs
To keep your container up to date, you have two options:
make update-container
docker-compose stop
docker-compose pull
docker-compose up -d
Don't forget the PUID and GUID. :P
The make logs
command will show you something like this:
Downloading mojang_1.xx.xx.jar
mcserver-zulu | Failed to download mojang_1.xx.xx.jar
mcserver-zulu | java.net.UnknownHostException: xxxxxxxx.mojang.com
Probably you're using WSL2 and you have problems with the DNS server. Modify/create the /etc/docker/daemon.json
file and add your preferred DNS server.
Example:
sudo nano /etc/docker/daemon.json
Add:
{
"dns": ["1.1.1.1", "8.8.8.8"]
}
Modify the docker-compose.yml
. Add this flag -DPurpur.IReallyDontWantSpark=true
to the PURPURMC_FLAGS
environment variable.
This repo is based on the work of mtoensing
.
This project is designed for servers with diverse purposes and may not be the most suitable option for a large-scale server with high player concurrency. It may require additional improvements and adjustments to effectively cater to such specific requirements. Thoroughly evaluate the performance and scalability aspects before implementing it in a production environment.