Dagger
Search

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.0

Entrypoint

Return Type
Crane !
Arguments
NameTypeDescription
registryString registry to authenticate to
usernameString username to use for authentication with the registry
passwordSecret password to use for authentication with the registry
insecureBoolean allow insecure connections to the registry
platformString platform to request when listing images default to all platforms
Example
dagger -m github.com/vbehar/daggerverse/crane@96c205a08a7381709712e89ddede7d45c017b7c8 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@96c205a08a7381709712e89ddede7d45c017b7c8 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@96c205a08a7381709712e89ddede7d45c017b7c8 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@96c205a08a7381709712e89ddede7d45c017b7c8 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@96c205a08a7381709712e89ddede7d45c017b7c8 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@96c205a08a7381709712e89ddede7d45c017b7c8 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@96c205a08a7381709712e89ddede7d45c017b7c8 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
NameTypeDefault ValueDescription
args[String ! ] -arguments to pass to the glab CLI
ctrContainer -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@96c205a08a7381709712e89ddede7d45c017b7c8 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
NameTypeDefault ValueDescription
repositoryString !-repository to list images from
fullRefBoolean falseprint the full image reference
omitDigestTagsBoolean falseomit digest tags (e.g., ':sha256-...')
ctrContainer -No description provided
Example
dagger -m github.com/vbehar/daggerverse/crane@96c205a08a7381709712e89ddede7d45c017b7c8 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
NameTypeDefault ValueDescription
imageString !-image to check format: <repository>:<tag>
ctrContainer -No description provided
Example
dagger -m github.com/vbehar/daggerverse/crane@96c205a08a7381709712e89ddede7d45c017b7c8 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)
}