|
| 1 | +# Docker Hub Deployment Guide |
| 2 | + |
| 3 | +This guide explains how to set up automated Docker Hub builds for the Flora Chain peer node. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. Docker Hub account |
| 8 | +2. GitHub repository with admin access |
| 9 | +3. Docker Hub repository created |
| 10 | + |
| 11 | +## Setup Steps |
| 12 | + |
| 13 | +### 1. Create Docker Hub Repository |
| 14 | + |
| 15 | +1. Go to [Docker Hub](https://hub.docker.com) |
| 16 | +2. Click "Create Repository" |
| 17 | +3. Repository name: `flora-chain-testnet-peer` |
| 18 | +4. Description: `Production-ready Flora Chain peer node for testnet` |
| 19 | +5. Visibility: Public |
| 20 | +6. Click "Create" |
| 21 | + |
| 22 | +### 2. Configure GitHub Secrets |
| 23 | + |
| 24 | +Add these secrets to your GitHub repository: |
| 25 | + |
| 26 | +1. Go to GitHub repository β Settings β Secrets and variables β Actions |
| 27 | +2. Add the following secrets: |
| 28 | + |
| 29 | +| Secret Name | Value | Description | |
| 30 | +|-------------|-------|-------------| |
| 31 | +| `DOCKER_USERNAME` | Your Docker Hub username | Docker Hub login username | |
| 32 | +| `DOCKER_TOKEN` | Your Docker Hub access token | Docker Hub access token (not password) | |
| 33 | + |
| 34 | +### 3. Create Docker Hub Access Token |
| 35 | + |
| 36 | +1. Go to Docker Hub β Account Settings β Security |
| 37 | +2. Click "New Access Token" |
| 38 | +3. Token description: `GitHub Actions - flora-chain-testnet-peer` |
| 39 | +4. Access permissions: Read, Write, Delete |
| 40 | +5. Copy the token and add it to GitHub secrets as `DOCKER_TOKEN` |
| 41 | + |
| 42 | +### 4. Update Image Name (if needed) |
| 43 | + |
| 44 | +If your Docker Hub username/organization is different from `meta-flora`, update the image name in: |
| 45 | + |
| 46 | +- `.github/workflows/docker-build.yml` (line 8: `IMAGE_NAME`) |
| 47 | +- `README.md` (all references to `meta-flora/flora-chain-testnet-peer`) |
| 48 | +- `setup.sh` (line 36: Docker run command) |
| 49 | + |
| 50 | +### 5. Test the Build |
| 51 | + |
| 52 | +1. Push a commit to trigger the GitHub Action |
| 53 | +2. Check the Actions tab in GitHub |
| 54 | +3. Verify the build completes successfully |
| 55 | +4. Check Docker Hub for the new image |
| 56 | + |
| 57 | +## Build Triggers |
| 58 | + |
| 59 | +The GitHub Action will automatically build and push images when: |
| 60 | + |
| 61 | +- **Push to main branch**: Creates `latest` and `main` tags |
| 62 | +- **Create a tag**: Creates version tags (e.g., `v1.0.0`) |
| 63 | +- **Pull requests**: Builds but doesn't push (for testing) |
| 64 | + |
| 65 | +## Manual Build |
| 66 | + |
| 67 | +To manually build and push: |
| 68 | + |
| 69 | +```bash |
| 70 | +# Build for multiple architectures |
| 71 | +docker buildx build --platform linux/amd64,linux/arm64 \ |
| 72 | + -t meta-flora/flora-chain-testnet-peer:latest \ |
| 73 | + --push . |
| 74 | + |
| 75 | +# Build for specific architecture |
| 76 | +docker buildx build --platform linux/amd64 \ |
| 77 | + -t meta-flora/flora-chain-testnet-peer:latest \ |
| 78 | + --push . |
| 79 | +``` |
| 80 | + |
| 81 | +## Verification |
| 82 | + |
| 83 | +After the build completes: |
| 84 | + |
| 85 | +1. **Check Docker Hub**: Verify the image appears in your repository |
| 86 | +2. **Test locally**: Pull and run the image |
| 87 | +3. **Check platforms**: Ensure multi-architecture support works |
| 88 | + |
| 89 | +```bash |
| 90 | +# Test the Docker Hub image |
| 91 | +docker run -d --name test-flora-peer \ |
| 92 | + -p 26656:26656 -p 26657:26657 -p 1317:1317 -p 9090:9090 \ |
| 93 | + meta-flora/flora-chain-testnet-peer:latest |
| 94 | + |
| 95 | +# Check if it's running |
| 96 | +docker ps | grep test-flora-peer |
| 97 | + |
| 98 | +# Check logs |
| 99 | +docker logs test-flora-peer |
| 100 | + |
| 101 | +# Clean up |
| 102 | +docker stop test-flora-peer && docker rm test-flora-peer |
| 103 | +``` |
| 104 | + |
| 105 | +## Troubleshooting |
| 106 | + |
| 107 | +### Build Failures |
| 108 | + |
| 109 | +- Check GitHub Actions logs for specific errors |
| 110 | +- Verify Docker Hub credentials are correct |
| 111 | +- Ensure the Docker Hub repository exists and is accessible |
| 112 | + |
| 113 | +### Image Not Available |
| 114 | + |
| 115 | +- Wait a few minutes for Docker Hub to process the image |
| 116 | +- Check if the image was pushed to the correct repository |
| 117 | +- Verify the image name matches your Docker Hub username/organization |
| 118 | + |
| 119 | +### Multi-architecture Issues |
| 120 | + |
| 121 | +- Ensure Docker Buildx is available in the GitHub runner |
| 122 | +- Check that all target platforms are supported |
| 123 | +- Verify the base image supports multi-architecture builds |
| 124 | + |
| 125 | +## Maintenance |
| 126 | + |
| 127 | +- **Regular Updates**: Push changes to trigger new builds |
| 128 | +- **Version Tags**: Create Git tags for releases (e.g., `v1.0.0`) |
| 129 | +- **Security**: Regularly update base images and dependencies |
| 130 | +- **Monitoring**: Monitor Docker Hub repository for usage and issues |
0 commit comments