|
1 | | -# metamask-extension-e2e-image |
| 1 | +# MetaMask Extension E2E Docker Image |
| 2 | + |
| 3 | +This image is built for running MetaMask Extension end-to-end (E2E) tests. |
| 4 | +It includes: |
| 5 | + |
| 6 | +- Node 22.15 (with browsers) |
| 7 | +- Yarn 4.9.1 (via Corepack) |
| 8 | +- zstd compression tool |
| 9 | +- Xvfb for headless GUI environments |
| 10 | + |
| 11 | +## 🚀 Using the Image |
| 12 | + |
| 13 | +### Pull from GHCR |
| 14 | + |
| 15 | +```bash |
| 16 | +# Latest version |
| 17 | +docker pull ghcr.io/MetaMask/metamask-extension-e2e-image:latest |
| 18 | + |
| 19 | +# Specific version |
| 20 | +docker pull ghcr.io/MetaMask/metamask-extension-e2e-image:v1.0.0 |
| 21 | +``` |
| 22 | + |
| 23 | +### Authentication |
| 24 | + |
| 25 | +For public access, you can use any GitHub token: |
| 26 | + |
| 27 | +```bash |
| 28 | +# Login to GHCR |
| 29 | +echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin |
| 30 | + |
| 31 | +# Or using GitHub CLI |
| 32 | +gh auth token | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin |
| 33 | +``` |
| 34 | + |
| 35 | +### Using in CI/CD |
| 36 | + |
| 37 | +#### GitHub Actions |
| 38 | + |
| 39 | +```yaml |
| 40 | +steps: |
| 41 | + - name: Login to GHCR |
| 42 | + uses: docker/login-action@v3 |
| 43 | + with: |
| 44 | + registry: ghcr.io |
| 45 | + username: ${{ github.actor }} |
| 46 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + |
| 48 | + - name: Run E2E tests |
| 49 | + run: | |
| 50 | + docker run --rm -v $PWD:/workspace \ |
| 51 | + ghcr.io/MetaMask/metamask-extension-e2e-image:latest \ |
| 52 | + yarn test:e2e |
| 53 | +``` |
| 54 | +
|
| 55 | +#### Docker Compose |
| 56 | +
|
| 57 | +```yaml |
| 58 | +version: '3.8' |
| 59 | +services: |
| 60 | + e2e-tests: |
| 61 | + image: ghcr.io/MetaMask/metamask-extension-e2e-image:latest |
| 62 | + volumes: |
| 63 | + - ./:/workspace |
| 64 | + working_dir: /workspace |
| 65 | + command: yarn test:e2e |
| 66 | +``` |
| 67 | +
|
| 68 | +## 🔨 Building the Image Locally |
| 69 | +
|
| 70 | +```bash |
| 71 | +# Build for local development |
| 72 | +docker build -t metamask-extension-e2e-local . |
| 73 | + |
| 74 | +# Build with platform specification |
| 75 | +docker build --platform linux/amd64 -t metamask-extension-e2e-local . |
| 76 | +``` |
| 77 | + |
| 78 | +## 📦 Available Tags |
| 79 | + |
| 80 | +- `latest` - Latest build from main branch |
| 81 | +- `v*.*.*` - Tagged releases |
| 82 | +- `main` - Main branch builds |
| 83 | +- `<sha>` - Specific commit builds |
| 84 | + |
| 85 | +## 📋 Requirements |
| 86 | + |
| 87 | +- Docker |
| 88 | +- GitHub account (for pulling from GHCR) |
| 89 | +- GitHub token with `read:packages` permission |
| 90 | + |
| 91 | +## 🐛 Troubleshooting |
| 92 | + |
| 93 | +### Authentication Issues |
| 94 | + |
| 95 | +```bash |
| 96 | +# Check if you're logged in |
| 97 | +docker system info | grep -i registry |
| 98 | + |
| 99 | +# Test image access |
| 100 | +docker run --rm ghcr.io/MetaMask/metamask-extension-e2e-image:latest echo "Success" |
| 101 | +``` |
| 102 | + |
| 103 | +### Common Solutions |
| 104 | + |
| 105 | +1. **Permission Denied**: Ensure your GitHub token has `read:packages` permission |
| 106 | +2. **Image Not Found**: Check image name spelling and tag existence |
| 107 | +3. **Rate Limiting**: Use authenticated requests to avoid rate limits |
| 108 | + |
| 109 | +## 🏗️ Development |
| 110 | + |
| 111 | +This image is automatically built and pushed to GHCR on: |
| 112 | +- All branch commits (for testing and development) |
| 113 | +- Tagged releases |
| 114 | +- Pull requests |
| 115 | + |
| 116 | +## 📞 Support |
| 117 | + |
| 118 | +- **Issues**: Open an issue in this repository |
| 119 | +- **Internal**: Contact via Slack #mmig-devsecops-random |
0 commit comments