This guide covers running DMR-Nexus in Docker with automatic version management based on git tags.
The easiest way to build with automatic versioning:
./build-docker.shThis will:
- Automatically detect the git version (tag + commit hash)
- Build the Docker image with version labels
- Tag as both
dmr-nexus:latestanddmr-nexus:<version>
# Copy sample config
cp configs/config.sample.yaml config.yaml
# Edit config.yaml as needed
vim config.yaml
# Start the service
./docker-compose.sh up -d
# View logs
./docker-compose.sh logs -f
# Stop the service
./docker-compose.sh downIf you prefer manual control:
# Build with auto-detected version
docker build \
--build-arg VERSION=auto \
--build-arg GIT_COMMIT=auto \
--build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t dmr-nexus:latest \
.
# Or specify version manually
docker build \
--build-arg VERSION=v1.0.0 \
--build-arg GIT_COMMIT=abc1234 \
--build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t dmr-nexus:v1.0.0 \
.# Create directories
mkdir -p data logs
# Run container
docker run -d \
--name dmr-nexus \
--restart unless-stopped \
-p 62031:62031/udp \
-p 8080:8080 \
-p 9090:9090 \
-v $(pwd)/config.yaml:/etc/dmr-nexus/config.yaml:ro \
-v $(pwd)/data:/app/data \
-v $(pwd)/logs:/var/log/dmr-nexus \
-e TZ=America/New_York \
dmr-nexus:latestThe docker-compose.yml includes:
62031/udp- DMR peer protocol8080/tcp- Web UI and API9090/tcp- Prometheus metrics
./config.yaml- Configuration file (read-only)dmr-data- Persistent data (database, etc.)dmr-logs- Log files
TZ- Timezone (default: UTC)VERSION- Build version (auto-detected from git)GIT_COMMIT- Git commit hash (auto-detected)BUILD_TIME- Build timestamp (auto-generated)
The build system automatically uses git to determine the version:
# If you have tags
git tag v1.0.0
./build-docker.sh
# → Builds as dmr-nexus:v1.0.0
# If no tags (uses commit hash)
./build-docker.sh
# → Builds as dmr-nexus:abc1234
# If you have uncommitted changes
./build-docker.sh
# → Builds as dmr-nexus:v1.0.0-dirty# Check version in running container
docker exec dmr-nexus /usr/local/bin/dmr-nexus --version
# Or from logs
docker logs dmr-nexus 2>&1 | grep "version"The container includes automatic health checking:
# Check health status
docker ps
# Look for "(healthy)" in STATUS column
# View health check logs
docker inspect dmr-nexus | jq '.[0].State.Health'./docker-compose.sh logs -f dmr-nexusdocker exec -it dmr-nexus /bin/sh./docker-compose.sh restart./build-docker.sh
./docker-compose.sh up -d --force-recreateFor production, consider:
- Use specific version tags instead of
latest - Enable Prometheus metrics and monitoring
- Set up log rotation for the logs volume
- Configure resource limits in docker-compose.yml:
services: dmr-nexus: deploy: resources: limits: cpus: '2' memory: 1G reservations: cpus: '1' memory: 512M
- Use secrets for sensitive config instead of volume mounts
- Set up automated backups of the data volume
To build for multiple architectures:
# Build for linux/amd64 and linux/arm64
docker buildx create --use
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=auto \
--build-arg GIT_COMMIT=auto \
--build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t dmr-nexus:latest \
--push \
.