Devsy
Tutorials

Reduce build times with remote caching

Devsy can use a container registry as a remote build cache. Later builds reuse 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

The Docker provider needs the containerd image store in the Docker daemon. Add this to your existing /etc/docker/daemon.json, or use Settings > Docker Engine in Docker Desktop. Keep the other settings in the file:

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

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

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

Switching the storage backend keeps images and containers. Items stored under the old backend are hidden 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 cached layers and rebuild only what changed.

How Devsy detects changes

Devsy finds the files that affect the build from your Dockerfile and devcontainer.json 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 without a Docker daemon. Whether the build runs without root depends on the base image and Dockerfile commands.

On this page