MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / Container

Method Container

extras/dagger/main.go:687–712  ·  view source on GitHub ↗

Build an ephemeral container with everything needed to process the attestation

(
	// Cache TTL for chainloop commands, in seconds
	//  Defaults to 0: no caching
	// +optional
	// +default=0
	ttl int,
)

Source from the content-addressed store, hash-verified

685
686// Build an ephemeral container with everything needed to process the attestation
687func (att *Attestation) Container(
688 // Cache TTL for chainloop commands, in seconds
689 // Defaults to 0: no caching
690 // +optional
691 // +default=0
692 ttl int,
693) *dagger.Container {
694 ctr := cliContainer(ttl, att.Token, att.Client.Instance, att.parentCIContext, att.githubEventFile, att.Client.Enterprise)
695 if att.repository != nil {
696 ctr = ctr.WithDirectory(".", att.repository)
697 }
698
699 if addr := att.RegistryAuth.Address; addr != "" {
700 ctr = ctr.WithEnvVariable("CHAINLOOP_REGISTRY_SERVER", addr)
701 }
702
703 if user := att.RegistryAuth.Username; user != "" {
704 ctr = ctr.WithEnvVariable("CHAINLOOP_REGISTRY_USERNAME", user)
705 }
706
707 if pw := att.RegistryAuth.Password; pw != nil {
708 ctr = ctr.WithSecretVariable("CHAINLOOP_REGISTRY_PASSWORD", pw)
709 }
710
711 return ctr
712}
713
714type OutputFormat string
715

Callers 8

InitMethod · 0.95
StatusMethod · 0.95
AddRawEvidenceMethod · 0.95
AddFileEvidenceMethod · 0.95
DebugMethod · 0.95
PushMethod · 0.95
resetMethod · 0.95
cliContainerFunction · 0.80

Calls 1

cliContainerFunction · 0.85

Tested by

no test coverage detected