2.0 KiB
2.0 KiB
Docker Hub Integration Setup
Required Secrets
Add these secrets to your Gitea repository settings:
1. DOCKER_HUB_USERNAME
- Your Docker Hub username (e.g., "jskala")
2. DOCKER_HUB_TOKEN
- Your Docker Hub access token (NOT your password)
Creating a Docker Hub Access Token
- Go to Docker Hub
- Sign in to your account
- Click your avatar → Account Settings
- Go to Security tab
- Click New Access Token
- Name it:
NFOGuard-CI - Permissions: Read, Write, Delete
- Click Generate
- Copy the token immediately (you won't see it again)
Adding Secrets to Gitea
- Go to your NFOguard repository in Gitea
- Click Settings → Secrets
- Add the following secrets:
-
Name:
DOCKER_HUB_USERNAME -
Value: Your Docker Hub username
-
Name:
DOCKER_HUB_TOKEN -
Value: The access token you generated
-
What Gets Published
Main Branch (Production)
yourusername/nfoguard:latestyourusername/nfoguard:v1.5.2(version from VERSION file)yourusername/nfoguard:sha-abc123(git commit SHA)
Dev Branch
yourusername/nfoguard:devyourusername/nfoguard:dev-sha-abc123
Usage Examples
Once set up, users can pull from either registry:
# From your local Gitea registry (fast for you)
docker pull 192.168.253.221:3000/jskala/nfoguard:latest
# From Docker Hub (public access)
docker pull yourusername/nfoguard:latest
# Dev versions
docker pull yourusername/nfoguard:dev
Testing the Setup
After adding the secrets, push a commit to trigger the CI:
git add .
git commit -m "Add Docker Hub CI integration"
git push origin main
Watch the Actions tab in Gitea to see both registries being pushed to successfully!
Benefits
- Local: Ultra-fast local builds and deployment
- Public: Anyone can use
docker pull yourusername/nfoguard:latest - Redundancy: Multiple image sources
- Versioning: Proper semantic versioning across both registries