depot
The Depot module can be used to route any container image build to our remote build service. You can use it to build container images on fast native Intel & Arm CPUs with persistent layer cache on NVMe disks. We have functions for both depot build and depot bake.With build, we build your container image for the Dockerfile you specify and return you the built container to use in your pipeline. With bake, you can pass in your bake file and we will build all of the targets in your bake file concurrently.
For more examples of cool things you can do with Dagger + Depot, check out our README in our Daggerverse repo.
Installation
dagger install github.com/depot/daggerverse/depot@v1.2.0
Entrypoint
Return Type
Depot
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
func (m *myModule) example() *Depot {
return dag.
Depot()
}
@function
def example() -> dag.Depot:
return (
dag.depot()
)
@func()
example(): Depot {
return dag
.depot()
}
Types
Depot 🔗
build() 🔗
Build builds a container image artifact from a Dockerfile using https://depot.dev.
Example usage: dagger call build --token env:DEPOT_TOKEN --project $DEPOT_PROJECT --directory . --lint container
Return Type
BuildArtifact !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
depotVersion | String | - | Depot CLI version |
token | Secret ! | - | Depot token |
project | String ! | - | Depot project id |
directory | Directory ! | - | Source context directory for build |
dockerfile | String | "Dockerfile" | Path to dockerfile |
platforms | [String ! ] | null | Platforms are architecture and OS combinations for which to build the image. |
sbom | Boolean | false | Produce software bill of materials for image |
noCache | Boolean | false | D not use layer cache when building the image |
noSave | Boolean | false | Do not save the image to the depot ephemeral registry |
lint | Boolean | false | Lint dockerfile |
buildArgs | [String ! ] | null | No description provided |
labels | [String ! ] | null | Labels to apply to the image |
outputs | [String ! ] | null | Outputs override the default |
provenance | String | - | No description provided |
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
build --token env:MYSECRET --project string --directory DIR_PATH
func (m *myModule) example(token *Secret, project string, directory *Directory) *DepotBuildArtifact {
return dag.
Depot().
Build(token, project, directory)
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> dag.DepotBuildArtifact:
return (
dag.depot()
.build(token, project, directory)
)
@func()
example(token: Secret, project: string, directory: Directory): DepotBuildArtifact {
return dag
.depot()
.build(token, project, directory)
}
bake() 🔗
Bake builds many containers using https://depot.dev.
example usage: dagger call bake --token $DEPOT_TOKEN --project $DEPOT_PROJECT --directory . --bake-file docker-bake.hcl
Return Type
Artifacts !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
depotVersion | String | - | depot CLI version |
token | Secret ! | - | depot token |
project | String ! | - | depot project id |
directory | Directory ! | - | source context directory for build |
bakeFile | String ! | - | path to bake definition file |
sbom | Boolean | false | produce software bill of materials for image |
noCache | Boolean | false | do not use layer cache when building the image |
noSave | Boolean | false | Do not save the image to the depot ephemeral registry |
lint | Boolean | false | lint dockerfile |
provenance | String | - | No description provided |
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string
func (m *myModule) example(token *Secret, project string, directory *Directory, bakeFile string) *DepotArtifacts {
return dag.
Depot().
Bake(token, project, directory, bakeFile)
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str) -> dag.DepotArtifacts:
return (
dag.depot()
.bake(token, project, directory, bake_file)
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string): DepotArtifacts {
return dag
.depot()
.bake(token, project, directory, bakeFile)
}
BuildArtifact 🔗
buildId() 🔗
depot build id
Return Type
String !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
build-id
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory, bakeFile string, target string) string {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
BuildId(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> str:
return await (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.build_id()
)
@func()
async example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Promise<string> {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.buildId()
}
token() 🔗
depot token
Return Type
Secret !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
token
func (m *myModule) example(token *Secret, project string, directory *Directory, bakeFile string, target string) *Secret {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
Token()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> dagger.Secret:
return (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.token()
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Secret {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.token()
}
project() 🔗
depot project id
Return Type
String !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
project
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory, bakeFile string, target string) string {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
Project(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> str:
return await (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.project()
)
@func()
async example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Promise<string> {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.project()
}
target() 🔗
Return Type
String !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
target
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory, bakeFile string, target string) string {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
Target(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> str:
return await (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.target()
)
@func()
async example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Promise<string> {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.target()
}
sbomdir() 🔗
Return Type
Directory !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
sbomdir
func (m *myModule) example(token *Secret, project string, directory *Directory, bakeFile string, target string) *Directory {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
Sbomdir()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> dagger.Directory:
return (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.sbomdir()
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Directory {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.sbomdir()
}
imageName() 🔗
Return Type
String !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
image-name
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory, bakeFile string, target string) string {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
ImageName(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> str:
return await (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.image_name()
)
@func()
async example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Promise<string> {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.imageName()
}
size() 🔗
Return Type
Integer !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
size
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory, bakeFile string, target string) int {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
Size(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> int:
return await (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.size()
)
@func()
async example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Promise<number> {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.size()
}
container() 🔗
Creates a container from the recently built image artifact.
Return Type
Container !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
container
func (m *myModule) example(token *Secret, project string, directory *Directory, bakeFile string, target string) *Container {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
Container()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> dagger.Container:
return (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.container()
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Container {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.container()
}
imageBytes() 🔗
Returns the size in bytes of the image.
Return Type
Integer !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
image-bytes
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory, bakeFile string, target string) int {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
ImageBytes(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> int:
return await (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.image_bytes()
)
@func()
async example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): Promise<number> {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.imageBytes()
}
sbom() 🔗
Returns an SBOM if built option --sbom
was requested.
Returns an error if the build did not produce SBOMs.
Return Type
File !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string \
sbom
func (m *myModule) example(token *Secret, project string, directory *Directory, bakeFile string, target string) *File {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target).
Sbom()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> dagger.File:
return (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
.sbom()
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): File {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
.sbom()
}
Artifacts 🔗
artifacts() 🔗
Return Type
[BuildArtifact ! ] !
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
artifacts
func (m *myModule) example(token *Secret, project string, directory *Directory, bakeFile string) []*DepotBuildArtifact {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Artifacts()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str) -> List[dag.DepotBuildArtifact]:
return (
dag.depot()
.bake(token, project, directory, bake_file)
.artifacts()
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string): DepotBuildArtifact[] {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.artifacts()
}
get() 🔗
Return Type
BuildArtifact !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
target | String ! | - | No description provided |
Example
dagger -m github.com/depot/daggerverse/depot@ee5c47d2ca45ab6b7ac2639c9383beb0322079b8 call \
bake --token env:MYSECRET --project string --directory DIR_PATH --bake-file string \
get --target string
func (m *myModule) example(token *Secret, project string, directory *Directory, bakeFile string, target string) *DepotBuildArtifact {
return dag.
Depot().
Bake(token, project, directory, bakeFile).
Get(target)
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str, target: str) -> dag.DepotBuildArtifact:
return (
dag.depot()
.bake(token, project, directory, bake_file)
.get(target)
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string, target: string): DepotBuildArtifact {
return dag
.depot()
.bake(token, project, directory, bakeFile)
.get(target)
}