Skip to content

Commit

Permalink
add example of project_id for HCL files
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegalbraith committed Oct 20, 2024
1 parent f37e780 commit 88ddb6f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions content/cli/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,28 @@ To build all of the images we just need to call `bake`:
depot bake -f docker-bake.hcl
```

If you want to build different targets in the bake file with different Depot projects, you can specify the `project_id` in the `target` block:

```hcl
group "default" {
targets = ["original", "db"]
}
target "original" {
dockerfile = "Dockerfile"
platforms = ["linux/amd64", "linux/arm64"]
tags = ["example/app:test"]
project_id = "project-id-1"
}
target "db" {
dockerfile = "Dockerfile.db"
platforms = ["linux/amd64", "linux/arm64"]
tags = ["example/db:test"]
project_id = "project-id-2"
}
```

If you want to build a specific target in the bake file, you can specify it in the `bake` command:

```shell
Expand Down

0 comments on commit 88ddb6f

Please sign in to comment.