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

Entrypoint

Return Type
Crane !
Arguments
NameTypeDefault ValueDescription
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
func (m *myModule) example() *Crane  {
	return dag.
			Crane()
}

Types

Crane 🔗

Crane is a Dagger Module to interact with the Crane CLI.

registry() 🔗

Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Crane().
			Registry(ctx)
}

username() 🔗

Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Crane().
			Username(ctx)
}

password() 🔗

Return Type
Secret !
Example
func (m *myModule) example() *Secret  {
	return dag.
			Crane().
			Password()
}

insecure() 🔗

Return Type
Boolean !
Example
func (m *myModule) example(ctx context.Context) bool  {
	return dag.
			Crane().
			Insecure(ctx)
}

platform() 🔗

Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Crane().
			Platform(ctx)
}

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
func (m *myModule) 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
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Crane().
			Run(ctx)
}

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
func (m *myModule) example(ctx context.Context, repository string) []string  {
	return dag.
			Crane().
			Ls(ctx, 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
func (m *myModule) example(ctx context.Context, image string) bool  {
	return dag.
			Crane().
			ImageTagExists(ctx, image)
}