Prebuild a Workspace
A prebuild is an image built ahead of time from devcontainer.json, its features, and any Dockerfile. When a prebuild exists, Devsy starts from it instead of building, which saves time on complex environments.
How it works
Devsy hashes the devcontainer configuration and uses devsy- plus the hash as the image tag. When you point Devsy at an image repository, it looks for that tag and uses the image if found.
Build and push a prebuild:
devsy workspace build github.com/my-org/my-repo --repository ghcr.io/my-org/my-repoDevsy skips the build if the repository already has an image with the matching tag. It uses your current provider, so you can prebuild on a remote provider or a dedicated one.
Use a prebuild
Pass the repository when you create a workspace:
devsy workspace up github.com/my-org/my-repo --prebuild-repo ghcr.io/my-org/my-repoOr set it in devcontainer.json, which suits builds run from CI:
{
"name": "my-project",
"customizations": {
"devsy": {
"prebuildRepository": "ghcr.io/my-org/my-repo"
}
}
}If no matching image is found, or you lack credentials for the repository, Devsy skips it and builds as usual.