crane
Crane is a command-line tool that allows you to interact with container registries.See https://github.com/google/go-containerregistry/tree/main/cmd/crane for more information.
Installation
dagger install github.com/vbehar/daggerverse/crane@v0.5.2
Entrypoint
Return Type
Crane !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
registry | String | - | registry to authenticate to |
username | String | - | username to use for authentication with the registry |
password | Secret | - | password to use for authentication with the registry |
insecure | Boolean | - | allow insecure connections to the registry |
platform | String | - | platform to request when listing images default to all platforms |
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
func (m *myModule) example() *Crane {
return dag.
Crane()
}
@function
def example() -> dag.Crane:
return (
dag.crane()
)
@func()
example(): Crane {
return dag
.crane()
}
Types
Crane 🔗
Crane is a Dagger Module to interact with the Crane CLI.
registry() 🔗
Return Type
String !
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
registry
func (m *myModule) example(ctx context.Context) string {
return dag.
Crane().
Registry(ctx)
}
@function
async def example() -> str:
return await (
dag.crane()
.registry()
)
@func()
async example(): Promise<string> {
return dag
.crane()
.registry()
}
username() 🔗
Return Type
String !
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
username
func (m *myModule) example(ctx context.Context) string {
return dag.
Crane().
Username(ctx)
}
@function
async def example() -> str:
return await (
dag.crane()
.username()
)
@func()
async example(): Promise<string> {
return dag
.crane()
.username()
}
password() 🔗
Return Type
Secret !
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
password
func (m *myModule) example() *Secret {
return dag.
Crane().
Password()
}
@function
def example() -> dagger.Secret:
return (
dag.crane()
.password()
)
@func()
example(): Secret {
return dag
.crane()
.password()
}
insecure() 🔗
Return Type
Boolean !
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
insecure
func (m *myModule) example(ctx context.Context) bool {
return dag.
Crane().
Insecure(ctx)
}
@function
async def example() -> bool:
return await (
dag.crane()
.insecure()
)
@func()
async example(): Promise<boolean> {
return dag
.crane()
.insecure()
}
platform() 🔗
Return Type
String !
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
platform
func (m *myModule) example(ctx context.Context) string {
return dag.
Crane().
Platform(ctx)
}
@function
async def example() -> str:
return await (
dag.crane()
.platform()
)
@func()
async example(): Promise<string> {
return dag
.crane()
.platform()
}
container() 🔗
Container returns a container with the Crane CLI installed and the registry configured - if a registry and credentials are provided.
Return Type
Container !
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
container
func (m *myModule) example() *Container {
return dag.
Crane().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.crane()
.container()
)
@func()
example(): Container {
return dag
.crane()
.container()
}
run() 🔗
Run runs the crane CLI with the given arguments.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] | - | arguments to pass to the glab CLI |
ctr | Container | - | container to use for the command, instead of the default container you can use this to customize the container |
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
run
func (m *myModule) example(ctx context.Context) string {
return dag.
Crane().
Run(ctx)
}
@function
async def example() -> str:
return await (
dag.crane()
.run()
)
@func()
async example(): Promise<string> {
return dag
.crane()
.run()
}
ls() 🔗
Ls lists the images in the given repository.
Return Type
[String ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
repository | String ! | - | repository to list images from |
fullRef | Boolean | false | print the full image reference |
omitDigestTags | Boolean | false | omit digest tags (e.g., ':sha256-...') |
ctr | Container | - | No description provided |
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
ls --repository string
func (m *myModule) example(ctx context.Context, repository string) []string {
return dag.
Crane().
Ls(ctx, repository)
}
@function
async def example(repository: str) -> List[str]:
return await (
dag.crane()
.ls(repository)
)
@func()
async example(repository: string): Promise<string[]> {
return dag
.crane()
.ls(repository)
}
imageTagExists() 🔗
ImageTagExists checks if the given image tag exists.
Return Type
Boolean !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | - | image to check format: <repository>:<tag> |
ctr | Container | - | No description provided |
Example
dagger -m github.com/vbehar/daggerverse/crane@a9504d940c730129f3c9f371d9c72d90396aaf7d call \
image-tag-exists --image string
func (m *myModule) example(ctx context.Context, image string) bool {
return dag.
Crane().
ImageTagExists(ctx, image)
}
@function
async def example(image: str) -> bool:
return await (
dag.crane()
.image_tag_exists(image)
)
@func()
async example(image: string): Promise<boolean> {
return dag
.crane()
.imageTagExists(image)
}