We use cookies to understand how people use Depot.
Container Builds

Quickstart for faster Docker image builds with Depot

Below is a guide to leveraging Depot for up to 40x faster container image builds with a literal drop-in replacement for docker build.

We also offer managed GitHub Actions Runners with 10x faster caching, you can get started with our runners in our GitHub Actions Overview docs.

Installing the CLI

For Mac, you can install the CLI with Homebrew:

brew install depot/tap/depot

For Linux, you can install the CLI with our installation script:

# Install the latest version
curl -L https://depot.dev/install-cli.sh | sh
 
# Install a specific version
curl -L https://depot.dev/install-cli.sh | sh -s 2.45.5

For all other platforms, you can download the binary directly from the latest release.

Creating an organization

Organizations are the top level entity in Depot. They typically represent a single company or team. Billing details are attached to an organization.

  1. Login to your Depot account to get to your list of organizations
  2. Click on the Create Organization button
  3. Enter an organization name
  4. Click Create organization

Creating a project

A project is like a cache namespace. Any Dockerfile or git repositories you build within a project will share the same cache. When you have a service, Docker image, or repository that should be segregated, you should create a new project.

  1. Go to your organizations inside of Depot
  2. Click on the Create Project button
  3. Enter a project name
  4. Choose the region for your project (i.e. where build data should be stored)
  5. Select a cache storage policy (i.e. how much build cache to keep)
  6. Click Create Project

Note: You can always change the region and cache storage policy for a project later.

Running a local build

There are two options for running local builds with Depot. You can use our depot build command which is a drop-in replacement for your existing docker build command.

Once you've initialized your project, you can run depot build to build your Docker image. The build command takes all of the same parameters as your normal docker build command.

depot build -t repo/image:tag .

Your first depot build locally will ask you to authenticate with Depot and choose the project for your build. The CLI will prompt you to save this project in a depot.json file in your repository. This file is used to remember your project for future builds.

Note: You can also specify a DEPOT_PROJECT_ID environment variable instead of saving a depot.json file.

Using Depot with your existing docker build

There is the option to configure your existing docker build commmands to leverage Depot behind the scenes for the build. This is done by configuring Depot as a plugin for the Docker CLI. You can see our depot configure-docker docs for more information.

Running a build in CI

Integrating Depot into your CI workflow is a very similar process. Depot works with any CI provider, you can find guides for our most popular providers:

Adding a build minute usage cap

By default, an organization is allowed to use unlimited build minutes in a month. However, you can configure a usage cap on your organization to avoid runaway costs.

  1. Go to your organizations inside of Depot and select your organization
  2. Click on the Settings button
  3. Under the Usage caps section you can choose between two options:
  • Unlimited: By default organizations are configured to use unlimited build minutes in a month
  • Limit build minutes: You can enter a fixed number of build minutes that your organization is allowed to use in a month. Once the limit is reached, builds will fail to start until the limit is raised or reset.