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.0.0
Entrypoint
Return Type
Depot
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 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@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 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
Container !
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 |
lint | Boolean | false | lint dockerfile |
provenance | String | - | No description provided |
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 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) *Container {
return dag.
Depot().
Bake(token, project, directory, bakeFile)
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory, bake_file: str) -> dagger.Container:
return (
dag.depot()
.bake(token, project, directory, bake_file)
)
@func()
example(token: Secret, project: string, directory: Directory, bakeFile: string): Container {
return dag
.depot()
.bake(token, project, directory, bakeFile)
}
BuildArtifact 🔗
token() 🔗
depot token
Return Type
Secret !
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
token
func (m *myModule) example(token *Secret, project string, directory *Directory) *Secret {
return dag.
Depot().
Build(token, project, directory).
Token()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> dagger.Secret:
return (
dag.depot()
.build(token, project, directory)
.token()
)
@func()
example(token: Secret, project: string, directory: Directory): Secret {
return dag
.depot()
.build(token, project, directory)
.token()
}
project() 🔗
depot project id
Return Type
String !
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
project
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory) string {
return dag.
Depot().
Build(token, project, directory).
Project(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> str:
return await (
dag.depot()
.build(token, project, directory)
.project()
)
@func()
async example(token: Secret, project: string, directory: Directory): Promise<string> {
return dag
.depot()
.build(token, project, directory)
.project()
}
sbomdir() 🔗
Return Type
Directory !
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
sbomdir
func (m *myModule) example(token *Secret, project string, directory *Directory) *Directory {
return dag.
Depot().
Build(token, project, directory).
Sbomdir()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> dagger.Directory:
return (
dag.depot()
.build(token, project, directory)
.sbomdir()
)
@func()
example(token: Secret, project: string, directory: Directory): Directory {
return dag
.depot()
.build(token, project, directory)
.sbomdir()
}
imageName() 🔗
Return Type
String !
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
image-name
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory) string {
return dag.
Depot().
Build(token, project, directory).
ImageName(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> str:
return await (
dag.depot()
.build(token, project, directory)
.image_name()
)
@func()
async example(token: Secret, project: string, directory: Directory): Promise<string> {
return dag
.depot()
.build(token, project, directory)
.imageName()
}
size() 🔗
Return Type
Integer !
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
size
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory) int {
return dag.
Depot().
Build(token, project, directory).
Size(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> int:
return await (
dag.depot()
.build(token, project, directory)
.size()
)
@func()
async example(token: Secret, project: string, directory: Directory): Promise<number> {
return dag
.depot()
.build(token, project, directory)
.size()
}
container() 🔗
Creates a container from the recently built image artifact.
Return Type
Container !
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
container
func (m *myModule) example(token *Secret, project string, directory *Directory) *Container {
return dag.
Depot().
Build(token, project, directory).
Container()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> dagger.Container:
return (
dag.depot()
.build(token, project, directory)
.container()
)
@func()
example(token: Secret, project: string, directory: Directory): Container {
return dag
.depot()
.build(token, project, directory)
.container()
}
imageBytes() 🔗
Returns the size in bytes of the image.
Return Type
Integer !
Example
dagger -m github.com/depot/daggerverse/depot@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
image-bytes
func (m *myModule) example(ctx context.Context, token *Secret, project string, directory *Directory) int {
return dag.
Depot().
Build(token, project, directory).
ImageBytes(ctx)
}
@function
async def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> int:
return await (
dag.depot()
.build(token, project, directory)
.image_bytes()
)
@func()
async example(token: Secret, project: string, directory: Directory): Promise<number> {
return dag
.depot()
.build(token, project, directory)
.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@6959c9cc4d59d702301f7634cfe35e2de1fbeee5 call \
build --token env:MYSECRET --project string --directory DIR_PATH \
sbom
func (m *myModule) example(token *Secret, project string, directory *Directory) *File {
return dag.
Depot().
Build(token, project, directory).
Sbom()
}
@function
def example(token: dagger.Secret, project: str, directory: dagger.Directory) -> dagger.File:
return (
dag.depot()
.build(token, project, directory)
.sbom()
)
@func()
example(token: Secret, project: string, directory: Directory): File {
return dag
.depot()
.build(token, project, directory)
.sbom()
}