Docker Hub Setup Guide
This guide explains how to set up automated Docker image builds and pushes to Docker Hub.
Prerequisites
- Docker Hub Account: https://hub.docker.com/
- GitHub Repository: Your MDDB repository
- Docker Hub Access Token: For GitHub Actions
Step 1: Create Docker Hub Repository
- Log in to Docker Hub: https://hub.docker.com/
- Click "Create Repository"
- Repository details:
- Name:
mddb - Description: Use content from
docs/DOCKER_HUB_SHORT.txt - Visibility: Public
- Name:
- Click "Create"
Step 2: Generate Docker Hub Access Token
- Go to Account Settings โ Security: https://hub.docker.com/settings/security
- Click "New Access Token"
- Token details:
- Description:
GitHub Actions - MDDB - Access permissions:
Read, Write, Delete
- Description:
- Click "Generate"
- Copy the token (you won't see it again!)
Step 3: Add GitHub Secret
- Go to your GitHub repository
- Navigate to: Settings โ Secrets and variables โ Actions
- Click "New repository secret"
- Secret details:
- Name:
DOCKER_HUB_TOKEN - Value: Paste the Docker Hub access token
- Name:
- Click "Add secret"
Step 4: Update Docker Hub Description
- Copy content from
docs/DOCKER_HUB.md - Go to your Docker Hub repository: https://hub.docker.com/r/tradik/mddb
- Click "Edit" on the Overview tab
- Paste the content
- Click "Update"
Step 5: Verify Workflow
Push a tag to trigger the workflow:
git tag -a v2.0.0 -m "Release v2.0.0" git push origin v2.0.0Check GitHub Actions: https://github.com/tradik/mddb/actions
Verify Docker Hub: https://hub.docker.com/r/tradik/mddb/tags
Available Images
After successful build, the following images will be available:
Production Images
tradik/mddb:latest- Latest stable releasetradik/mddb:2.0.0- Specific versiontradik/mddb:2.0- Minor versiontradik/mddb:2- Major version
Development Images
tradik/mddb:dev- Latest development buildtradik/mddb:2.0.0-dev- Specific version dev build
Platforms
All images support:
linux/amd64(x86_64)linux/arm64(aarch64)
Testing Images
Pull and run production image:
docker pull tradik/mddb:latest
docker run -d \ --name mddb-test \ -p 11023:11023 \ -p 11024:11024 \ -e MDDB_EXTREME=true \ tradik/mddb:latest
Test the server:
curl http://localhost:11023/stats curl -X POST http://localhost:11023/add \ -H "Content-Type: application/json" \ -d '{ "collection": "test", "key": "hello", "lang": "en", "content_md": "# Hello MDDB!" }' curl http://localhost:11023/get/test/hello/en
Clean up:
docker stop mddb-test
docker rm mddb-test
Workflow Triggers
The Docker workflow runs on:
Tag push:
v*.*.*(e.g., v2.0.0)- Builds and pushes versioned images
- Updates
latesttag - Updates Docker Hub description
Main branch push:
- Builds and pushes
latesttag - For testing purposes
- Builds and pushes
Manual trigger:
- Go to Actions โ Docker Build and Push
- Click "Run workflow"
Troubleshooting
Authentication Failed
- Verify
DOCKER_HUB_TOKENsecret is set correctly - Check token hasn't expired
- Ensure token has write permissions
Build Failed
- Check GitHub Actions logs
- Verify Dockerfile exists and is valid
- Check if all dependencies are available
Image Not Appearing
- Wait a few minutes for Docker Hub to update
- Check if workflow completed successfully
- Verify repository name matches
Multi-platform Build Issues
- QEMU and Buildx are automatically set up
- Check if base images support both platforms
- Review build logs for platform-specific errors
Updating Docker Hub Description
The description is automatically updated on each release. To manually update:
- Edit
docs/DOCKER_HUB.md - Commit and push changes
- Trigger workflow (tag push or manual)
Or manually:
- Go to Docker Hub repository
- Click "Edit" on Overview tab
- Paste content from
docs/DOCKER_HUB.md - Click "Update"
Security Best Practices
- Never commit tokens: Use GitHub Secrets
- Rotate tokens regularly: Every 6-12 months
- Use minimal permissions: Read/Write only
- Monitor usage: Check Docker Hub activity logs
- Revoke unused tokens: Clean up old tokens
Support
For issues:
- GitHub Actions logs: https://github.com/tradik/mddb/actions
- Docker Hub support: https://hub.docker.com/support
- MDDB issues: https://github.com/tradik/mddb/issues