|
| 1 | +# Copilot Instructions for devcontainer-features |
| 2 | + |
| 3 | +## Project Overview |
| 4 | +- This repository provides reusable devcontainer features for Dev Containers. |
| 5 | +- Features are designed for cross-architecture (AMD64/ARM64) and cross-distro (Debian, Ubuntu, Alpine) compatibility. |
| 6 | +- Download URLs for binaries can be globally or per-feature overridden for corporate/cached environments. |
| 7 | +- Each feature is implemented as a self-contained directory under `features/src/<feature>/` with its own installer logic and documentation. |
| 8 | +- Each feature is implemented as a self-contained directory under `features/test/<feature>/` with its tests. |
| 9 | + |
| 10 | +## Key Components |
| 11 | +- `build.go`: Responsible for the overall build process, including generating the `README.md` files and managing the build lifecycle. |
| 12 | +- `features/src/<feature>/` — Source for each feature (e.g., go, node, docker-out, zig, git-lfs). Contains: |
| 13 | + - `devcontainer-feature.json`: Feature metadata and options. |
| 14 | + - `install.sh`, `installer.go`: Installation scripts and Go logic. |
| 15 | + - `README.md`: Usage and configuration options. This file is automatically generated with the "Update-Readme-Files" task from build.go. |
| 16 | +- `features/test/<feature>/` — Tests for each feature. Contains: |
| 17 | + - `scenarios.json`: File containing the different scenarios to test. |
| 18 | + - `<scenarioname.sh>`: Verify script for each scenario |
| 19 | + - `test-images.json`: File containing the test images to use. |
| 20 | +- `installer/` and `build/` — Shared Go utilities for downloading, extracting, and managing feature installation. |
| 21 | +- `override-all.env` — Example of all possible override environment variables for download URLs. |
| 22 | +- `README.md` — Documentation for the overall project and its features. |
| 23 | + |
| 24 | +## Developer Workflows |
| 25 | +- **Build**: Use Go to build/test feature logic. No monolithic build; each feature is self-contained. |
| 26 | +- **Testing**: Test scripts are in `features/test/<feature>/`. Use shell scripts for scenario-based testing. |
| 27 | +- **Overrides**: Set `DEV_FEATURE_OVERRIDE_LOCATION` to a file or URL for global download URL overrides. See `override-all.env` for supported keys. |
| 28 | +- **Version Resolution**: Features support both explicit and partial versioning. Set `versionResolve: true` to enable partial version resolution. |
| 29 | + |
| 30 | +## Project Conventions |
| 31 | +- Prefer explicit version pinning for reproducibility; partial versions require `versionResolve: true`. |
| 32 | +- Download URLs are split into `downloadUrlBase` and `downloadUrlPath` for flexibility with proxies/caches. |
| 33 | +- All features support ARM64 and AMD64 where possible; Alpine support is best-effort. |
| 34 | +- Use Go for core installer logic, with shell scripts for entrypoints. |
| 35 | + |
| 36 | +## Integration Points |
| 37 | +- Features can be used in any devcontainer by referencing the published image/tag. |
| 38 | +- Download and version resolution logic is centralized in Go utilities under `installer/`. |
| 39 | +- Global overrides are supported via environment variables or files (see `README.md`). |
| 40 | + |
| 41 | +## Examples |
| 42 | +- See `features/src/go/README.md` for Go feature usage and options. |
| 43 | +- See `features/src/docker-out/README.md` for Docker client integration. |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +For more, see the root `README.md` and each feature's `README.md`. When adding new features, follow the structure and conventions above. |
0 commit comments