Devsy
Tutorials

Reduce build times with remote caching

Devsy can use a container registry as a remote cache for builds. Prebuild once, and everyone who builds after that reuses the cached layers.

Set up

Point Devsy at a registry path, in the form domain/project/repo:

devsy context set -o REGISTRY_CACHE=gcr.io/my-project/my-dev-env

With the Docker provider, the Docker daemon needs the containerd image store. Merge this into your existing /etc/docker/daemon.json, or use Settings > Docker Engine in Docker Desktop, and keep any other settings already in the file:

{
  "features": {
    "containerd-snapshotter": true
  }
}

Restart Docker, then check that the containerd image store is active. The output should include driver-type io.containerd.snapshotter.v1:

docker info --format '{{.DriverStatus}}'

Switching the storage backend does not delete images or containers, but items stored under the old backend are not visible while the new one is active.

Populate the cache

Build the workspace image once to fill the cache:

devsy workspace build my-workspace

Later builds pull from the cache and build only what changed.

How Devsy detects changes

Devsy reads your Dockerfile and devcontainer.json, finds the files that affect the build, and hashes their contents into the image tag. When a file changes, the hash changes and Devsy rebuilds, reusing the cached layers it can. Follow Docker's Dockerfile best practices to keep rebuilds small.

Builds in Kubernetes

With the Kubernetes driver and no container runtime on your machine, Devsy builds the image in the cluster with Kaniko. Kaniko builds in userspace without a Docker daemon. Whether it can run without root depends on the base image and Dockerfile commands.

On this page