This repository automates the prebuilding of DevContainers using GitHub Actions. Prebuilt DevContainers speed up development setup by reducing build times, especially when using complex configurations.
- Automated DevContainer builds using GitHub Actions
- Multi-architecture support (
amd64
andarm64
) - GitHub Container Registry (GHCR) integration for storing and retrieving prebuilt images
- Docker installed locally (optional, for manual builds)
- GitHub account with access to GitHub Actions
- GitHub Container Registry enabled
- Create a Personal Access Token (PAT) with
write:packages
andread:packages
permissions. - Store the token as a GitHub Actions secret named
GHCR_PAT
.
The prebuilt DevContainer is automatically built and pushed to GHCR when:
- A commit is pushed to the
main
branch - The workflow is manually triggered
The GitHub Actions workflow performs the following steps:
- Checkout the repository
- Setup QEMU and Buildx for multi-architecture builds
- Login to GitHub Container Registry (GHCR)
- Build and push the DevContainer image
To use the prebuilt container in VS Code:
- Open the repository in VS Code.
- Ensure the Dev Containers extension is installed.
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
) and selectDev Containers: Rebuild and Reopen in Container
.
- Building for multiple architectures (
amd64
andarm64
) can be slow (~1 hour on GitHub runners). - Consider using self-hosted runners for faster builds.
This repository is licensed under the MIT License.
Contributions are welcome! Feel free to open an issue or submit a pull request.