To run builds with Depot via docker
, you still need to connect the build to an active Depot project via the depot init
and depot.json
files or via the DEPOT_PROJECT_ID
environment variable.
Depot can directly integrate with your existing Docker workflows via a one-time configuration command from our depot
CLI. See our instructions for installing our CLI if you still need to do so.
With the CLI installed, you can run configure-docker
to configure your Docker CLI to use Depot as the default handler for docker build
and docker buildx build
:
Underneath the hood, the configure-docker
command installs Depot as a Docker CLI plugin and sets the plugin as the default Docker builder (i.e., docker build
). In addition, the command also installs a Depot buildx
driver and sets that driver as the default driver for docker buildx build
.
docker build
Once your docker
environment is configured to use Depot, you can run your builds as usual.
If you have correctly configured your Depot project via depot init
or DEPOT_PROJECT_ID
, your build will automatically be sent to Depot for execution. You can confirm this by looking for log lines in the output that are prefixed with [depot]
.
docker buildx build
Similarly, once your environment is configured to use Depot, you can run your docker buildx build
commands as usual.
Again, you can confirm that builds are going to your Depot project by looking for log lines that are prefixed with [depot]
or by checking out the builds for your project.
Once the configure-docker
command is executed, you can use Depot with Docker Compose without changing a single line of code. All you need to do is ensure you have a Depot project configured for your build. You can do this via:
DEPOT_PROJECT_ID
environment variable to the project ID of the project you want to use for buildsdepot init
in the root of the repository in which you're building your image. The command creates a depot.json file that our plugin will detect.Under the hood, docker compose build
uses docker buildx build
to build your images. As a result, you can use docker compose build
as usual, and your builds will be sent to Depot.
Because of how Compose communicates with the buildx
driver, there are a few things to be aware of:
compose.yml
file. For example, if you have a web
service and a worker
service and are building for linux/amd64
and linux/arm64
, you will have four builds created in Depot.If you prefer to use docker compose up
that works as well. The up
command will automatically build your images if not already built.