Skip to content

Commit

Permalink
Merge pull request #88 from depot/add-hcl-example
Browse files Browse the repository at this point in the history
Add example of `project_id` for HCL files
  • Loading branch information
KyleTryon authored Oct 23, 2024
2 parents f37e780 + 88ddb6f commit 50e0272
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 50e0272

Please sign in to comment.