|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Repository Overview |
| 6 | + |
| 7 | +This is a Docker release repository that builds and publishes Docker images for various services to multiple registries (Docker Hub, GitHub Container Registry, and AliCloud Container Registry). The repository contains a monorepo structure with each service having its own directory under `./Docker/`. |
| 8 | + |
| 9 | +## Architecture |
| 10 | + |
| 11 | +- **Docker Images**: Each service has its own directory under `./Docker/` containing a Dockerfile and associated files |
| 12 | +- **GitHub Actions**: Automated CI/CD workflows for building and publishing images |
| 13 | +- **Multi-Platform Support**: Images are built for multiple architectures (amd64, arm64, arm/v7, etc.) |
| 14 | +- **Multi-Registry Publishing**: Images are published to Docker Hub, GHCR, and AliCloud registries |
| 15 | + |
| 16 | +## Common Development Commands |
| 17 | + |
| 18 | +### Building Images Locally |
| 19 | + |
| 20 | +To build any Docker image locally: |
| 21 | + |
| 22 | +```bash |
| 23 | +# Navigate to the service directory |
| 24 | +cd ./Docker/[service-name] |
| 25 | + |
| 26 | +# Build the image |
| 27 | +docker build -t [service-name]:latest . |
| 28 | +``` |
| 29 | + |
| 30 | +### Testing Images |
| 31 | + |
| 32 | +Most services include docker-compose.yml files for local testing: |
| 33 | + |
| 34 | +```bash |
| 35 | +# Navigate to service directory |
| 36 | +cd ./Docker/[service-name] |
| 37 | + |
| 38 | +# Start with docker-compose |
| 39 | +docker-compose up -d |
| 40 | + |
| 41 | +# View logs |
| 42 | +docker-compose logs -f |
| 43 | + |
| 44 | +# Stop services |
| 45 | +docker-compose down |
| 46 | +``` |
| 47 | + |
| 48 | +### GitHub Actions Workflows |
| 49 | + |
| 50 | +The repository uses several GitHub Actions workflows: |
| 51 | + |
| 52 | +- **release.yml**: Main workflow for building and publishing Docker images |
| 53 | +- **dispatch-*.yml**: Workflows for specific service releases |
| 54 | +- **schedule-watch-offical.yml**: Scheduled workflow to watch for upstream updates |
| 55 | +- **check-offical-release.yml**: Workflow to check for new official releases |
| 56 | + |
| 57 | +### Service-Specific Operations |
| 58 | + |
| 59 | +Each service directory contains: |
| 60 | +- `Dockerfile`: Container build instructions |
| 61 | +- `README.md`: Service-specific documentation and deployment instructions |
| 62 | +- `docker-compose.yml` (optional): Local testing configuration |
| 63 | +- `entrypoint.sh` (optional): Custom container entrypoint scripts |
| 64 | + |
| 65 | +## Working with Services |
| 66 | + |
| 67 | +### Adding New Services |
| 68 | + |
| 69 | +1. Create a new directory under `./Docker/[service-name]` |
| 70 | +2. Add a Dockerfile following the repository's conventions |
| 71 | +3. Add a README.md with deployment instructions |
| 72 | +4. Update the main README.md to include the new service |
| 73 | +5. Create a dispatch workflow if needed |
| 74 | + |
| 75 | +### Updating Existing Services |
| 76 | + |
| 77 | +1. Modify the Dockerfile or related files in the service directory |
| 78 | +2. Test locally using docker-compose if available |
| 79 | +3. Update README.md if necessary |
| 80 | +4. The automated workflows will handle building and publishing |
| 81 | + |
| 82 | +## Key Files and Directories |
| 83 | + |
| 84 | +- `./Docker/`: Contains all service directories |
| 85 | +- `.github/workflows/`: CI/CD workflows |
| 86 | +- `README.md`: Main repository documentation with service list and deployment examples |
| 87 | + |
| 88 | +## Build Args and Environment Variables |
| 89 | + |
| 90 | +The build system automatically injects these build args: |
| 91 | +- `BUILD_DATE`: Build timestamp |
| 92 | +- `VCS_REF`: Git commit SHA |
| 93 | +- `VERSION`: Image version (inferred from tag when not "latest") |
| 94 | + |
| 95 | +Additional build args can be specified through workflow inputs. |
| 96 | + |
| 97 | +## Multi-Registry Support |
| 98 | + |
| 99 | +Images are automatically tagged and published to: |
| 100 | +- Docker Hub: `funnyzak/[service-name]:[tag]` |
| 101 | +- GitHub Container Registry: `ghcr.io/funnyzak/[service-name]:[tag]` |
| 102 | +- AliCloud Container Registry: `registry.cn-beijing.aliyuncs.com/funnyzak/[service-name]:[tag]` |
0 commit comments