Dev Containers are becoming a popular way to leverage a container as a fully featured development environment directly integrated with Visual Studio Code. You can open any folder inside a container and use the full power of VS Code inside.
With Depot, you can build your Dev Containers on demand with instant shared caching across your entire team.
Once the CLI is installed, you can configure your environment:
Run depot login to login to your Depot account
Change into the root of your project directory
Run depot init to link your project to your repository; this will create a depot.json directory in the current directory
Note: You can also connect depot to your project by passing the DEPOT_PROJECT_ID environment variable
Configure Docker to use Depot
Dev Containers uses the docker buildx build command internally to build the container image. You can configure Depot as a plugin for the Docker CLI and Buildx with the following command:
The configure-docker command is a one-time operation that routes any docker build or docker buildx build commands to Depot builders.
Build your Dev Container
There are multiple options for building your Dev Container:
You can open an existing folder in VS Code in a container, see these docs
You can open a Git repo or Pull Request in an isolated container, see these docs
You can also build your Dev container directly using the devcontainer CLI:
You should see something similar to the above in your VS Code or devcontainer build logs. You can see that the docker buildx build command is called, and then you see log lines for [depot] ... that confirm your Docker image build is routed to Depot builders.