Prerequisites
Before using MCReleaser with Docker, ensure you have:
- Docker installed on your system (Install Docker)
- Access to GitHub Container Registry (ghcr.io)
The MCReleaser Docker image is automatically built and published to ghcr.io/hsgamer/mcreleaser:master.
Quick Start
Run MCReleaser using Docker with a single command:
docker run \
-e NAME="Your Plugin Name" \
-e VERSION="1.0.0" \
-e DESCRIPTION="Your plugin description" \
-e GAME_VERSIONS="1.20.1,1.20.4" \
ghcr.io/hsgamer/mcreleaser:master
Docker Image
The official Docker image is available at:
ghcr.io/hsgamer/mcreleaser:master
Image Details
- Base Image: Eclipse Temurin 17 JRE Alpine
- Java Version: 17
- Size: Optimized with Alpine Linux
- Updated: Automatically built on every push to master branch
The master tag always points to the latest build from the master branch. For production use, consider using a specific version tag when available.
Usage Examples
Basic Example
Publish to a single platform:
docker run \
-e NAME="MyAwesomePlugin" \
-e VERSION="2.3.1" \
-e DESCRIPTION="A plugin that does amazing things" \
-e GAME_VERSIONS="1.19.4,1.20.1,1.20.4" \
-e MODRINTH_TOKEN="your_token_here" \
-e MODRINTH_PROJECT="your-project-id" \
-e MODRINTH_LOADERS="paper,spigot" \
ghcr.io/hsgamer/mcreleaser:master
Publish to multiple platforms simultaneously:
docker run \
-e NAME="MyPlugin" \
-e VERSION="1.0.0" \
-e DESCRIPTION="A comprehensive Minecraft plugin" \
-e GAME_VERSIONS="1.20.1,1.20.4" \
-e MODRINTH_TOKEN="$MODRINTH_TOKEN" \
-e MODRINTH_PROJECT="my-project" \
-e MODRINTH_LOADERS="paper,spigot,bukkit" \
-e HANGAR_KEY="$HANGAR_KEY" \
-e HANGAR_PROJECT="Username/ProjectName" \
-e HANGAR_CHANNEL="Release" \
ghcr.io/hsgamer/mcreleaser:master
Using Environment Files
For easier configuration management, use Docker’s --env-file option:
Create an environment file
Create a file named .env with your configuration:NAME=MyPlugin
VERSION=1.0.0
DESCRIPTION=A comprehensive Minecraft plugin
GAME_VERSIONS=1.20.1,1.20.4
# Platform tokens
MODRINTH_TOKEN=your_modrinth_token
MODRINTH_PROJECT=your-project-id
MODRINTH_LOADERS=paper,spigot
HANGAR_KEY=your_hangar_key
HANGAR_PROJECT=Username/Project
HANGAR_CHANNEL=Release
GITHUB_TOKEN=your_github_token
GITHUB_REPOSITORY=username/repository
GITHUB_REF=refs/tags/v1.0.0
Run with environment file
docker run --env-file .env ghcr.io/hsgamer/mcreleaser:master
Security Notice: Never commit .env files containing tokens to version control. Add .env to your .gitignore file.
Docker Compose
For more complex setups, use Docker Compose:
version: '3.8'
services:
mcreleaser:
image: ghcr.io/hsgamer/mcreleaser:master
environment:
NAME: "MyPlugin"
VERSION: "1.0.0"
DESCRIPTION: "A comprehensive Minecraft plugin"
GAME_VERSIONS: "1.20.1,1.20.4"
MODRINTH_TOKEN: ${MODRINTH_TOKEN}
MODRINTH_PROJECT: ${MODRINTH_PROJECT}
MODRINTH_LOADERS: "paper,spigot"
HANGAR_KEY: ${HANGAR_KEY}
HANGAR_PROJECT: ${HANGAR_PROJECT}
HANGAR_CHANNEL: "Release"
env_file:
- .env
Run with:
Volume Mounting
If you need to provide files (like JAR artifacts) to MCReleaser:
docker run \
-v $(pwd)/artifacts:/artifacts \
-e NAME="MyPlugin" \
-e VERSION="1.0.0" \
-e DESCRIPTION="Your plugin description" \
-e GAME_VERSIONS="1.20.1,1.20.4" \
ghcr.io/hsgamer/mcreleaser:master
Building from Source
If you want to build the Docker image locally:
Clone the repository
git clone https://github.com/HSGamer/MCReleaser.git
cd MCReleaser
Build the Docker image
docker build -t mcreleaser:local .
The Dockerfile uses a multi-stage build:
- Stage 1: Maven build with Eclipse Temurin 17
- Stage 2: Runtime with Eclipse Temurin 17 JRE Alpine
Run your local build
docker run \
-e NAME="MyPlugin" \
-e VERSION="1.0.0" \
-e DESCRIPTION="Test description" \
mcreleaser:local
Troubleshooting
Image Pull Issues
If you can’t pull the image:
# Try pulling explicitly
docker pull ghcr.io/hsgamer/mcreleaser:master
# Check Docker daemon status
docker info
Permission Errors
If you encounter permission errors with mounted volumes:
# Run with specific user ID
docker run --user $(id -u):$(id -g) \
-v $(pwd):/workspace \
ghcr.io/hsgamer/mcreleaser:master
Container Logs
View container logs for debugging:
# Run in foreground to see logs
docker run ghcr.io/hsgamer/mcreleaser:master
# Or check logs after running
docker logs <container_id>
Next Steps
Configuration
Learn about all available environment variables
GitHub Actions
Automate releases with CI/CD