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.9.0
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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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@527dd8483a56a2f9cc0ce9eb08b6663ddfb360f7 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)
}