Skip to content

Latest commit

 

History

History
146 lines (103 loc) · 4.29 KB

File metadata and controls

146 lines (103 loc) · 4.29 KB

Docker CI Setup Instructions

The Docker CI image is built and ready, but GitHub package permissions need to be configured before it can be used.

🔒 Current Status

Docker Image Built: ghcr.io/maikershq/maikers-mainframe-ci:latest
Cannot Push: 403 Forbidden (package permissions)
Standard CI Active: Using traditional tool installation (works but slower)
Docker CI Ready: Saved as ci-docker-ready.yml (activate when permissions fixed)

📋 How to Enable Docker CI

Step 1: Configure Package Permissions

The GITHUB_TOKEN in workflows needs permission to create/push packages. Choose one option:

Option A: Enable at Repository Level (Recommended)

  1. Go to repository Settings
  2. Navigate to ActionsGeneral
  3. Scroll to Workflow permissions
  4. Select "Read and write permissions"
  5. Check ✅ "Allow GitHub Actions to create and approve pull requests"
  6. Click Save

Option B: Use Personal Access Token (PAT)

  1. Create a PAT with write:packages scope
  2. Add as repository secret: DOCKER_REGISTRY_TOKEN
  3. Update docker-build.yml:
    - name: Log in to Container Registry
      uses: docker/login-action@v3
      with:
        registry: ghcr.io
        username: ${{ github.actor }}
        password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

Step 2: Trigger Docker Build

After fixing permissions:

# Trigger workflow manually
GitHub → Actions → "Build CI Docker Image" → Run workflow

# Or push a change to trigger auto-build
git commit --allow-empty -m "chore: trigger Docker image build"
git push

Step 3: Activate Docker CI

Once the image is successfully pushed:

# Switch to Docker-based CI
mv .github/workflows/ci.yml .github/workflows/ci-standard.yml
mv .github/workflows/ci-docker-ready.yml .github/workflows/ci.yml

# Commit and push
git add .github/workflows/
git commit -m "chore: activate Docker-based CI"
git push

🚀 What You'll Get

Performance Improvements

Job Before After Time Saved
rust-checks 10-12 min 2-3 min 70-80%
anchor-build 15-20 min 5-8 min 60-70%
typescript-checks 5-7 min 1-2 min 70-80%
security-audit 12-15 min 2-4 min 75-85%

Zero Installation Time

All pre-installed in Docker image:

  • ✅ Rust 1.88.0 (rustfmt, clippy)
  • ✅ Solana Agave 3.0.8
  • ✅ Anchor 0.31.1
  • ✅ Node.js 20 + Yarn
  • ✅ cargo-audit, jq, all build tools

🔍 Verifying the Fix

After enabling permissions, check that the workflow succeeds:

# Check GitHub Actions
https://github.com/maikershq/maikers-mainframe/actions

# Verify image is pushed
https://github.com/orgs/maikershq/packages/container/maikers-mainframe-ci

# Test locally
docker pull ghcr.io/maikershq/maikers-mainframe-ci:latest
docker run --rm -it ghcr.io/maikershq/maikers-mainframe-ci:latest bash

📝 Current Workflow Files

  • ci.yml - Standard CI (currently active) ✅
  • ci-docker-ready.yml - Docker CI (ready to activate)
  • docker-build.yml - Builds and publishes Docker image
  • security.yml - Security scans (Docker-ready)
  • verified-build.yml - Verified builds (Docker-ready)
  • release.yml - Release workflow (Docker-ready)

All workflows are configured to use Docker, they just need the image to be available!

⚠️ Troubleshooting

403 Forbidden Error Persists

If Option A doesn't work, the repository might be in an organization with restricted settings:

  1. Check organization settings: https://github.com/organizations/maikershq/settings/actions
  2. Ensure "Allow actions to create and push packages" is enabled
  3. Contact org admin if you don't have access

Image Pull Fails in CI

If workflows can't pull the image even after it's pushed:

  1. Make package public or
  2. Ensure package permissions allow repository access:
    • Go to package settings
    • Grant repository access under "Manage Actions access"

🎯 Expected Outcome

Once permissions are fixed:

  1. ✅ Docker image builds and pushes successfully
  2. ✅ All workflows pull image instantly
  3. ✅ CI runs 60-80% faster
  4. ✅ Zero tool installation overhead
  5. ✅ Consistent, reproducible builds

The infrastructure is ready, just needs a one-time permission configuration! 🚀