Documentation
¶
Overview ¶
Package llbtodagger converts BuildKit LLB definitions into Dagger call IDs.
The conversion is intentionally strict: if an LLB operation cannot be mapped faithfully to Dagger API fields/arguments, conversion returns an error.
Non-goals:
- Parsing Dockerfiles or any frontend input format directly.
- Supporting BuildOp, blob://, or custom-op conversion paths.
- Best-effort fallback when semantics are missing or lossy.
Index ¶
- Constants
- func DefinitionToID(def *pb.Definition, img *dockerspec.DockerOCIImage) (*call.ID, error)
- func DefinitionToIDWithOptions(def *pb.Definition, img *dockerspec.DockerOCIImage, opts DefinitionToIDOptions) (*call.ID, error)
- func DockerfileMainContextSentinelState() llb.State
- type DefinitionToIDOptions
- type UnsupportedOpError
Constants ¶
const ( // DockerfileMainContextSentinelLocalName is the deterministic local source // name used when dockerBuild injects a synthetic Dockerfile2LLB MainContext. DockerfileMainContextSentinelLocalName = "__dagger_dockerbuild_main_context_sentinel__" // DockerfileMainContextSentinelLocalName to avoid accidental matches. DockerfileMainContextSentinelSharedKeyHint = "__dagger_dockerbuild_main_context_sentinel__" )
Variables ¶
This section is empty.
Functions ¶
func DefinitionToID ¶
func DefinitionToID(def *pb.Definition, img *dockerspec.DockerOCIImage) (*call.ID, error)
DefinitionToID converts an LLB definition and image config metadata to a Dagger Container ID.
The conversion is strict and fail-fast: if any part of the definition cannot be represented faithfully as Dagger API calls, an error is returned.
func DefinitionToIDWithOptions ¶
func DefinitionToIDWithOptions(def *pb.Definition, img *dockerspec.DockerOCIImage, opts DefinitionToIDOptions) (*call.ID, error)
DefinitionToIDWithOptions is DefinitionToID with optional conversion controls.
func DockerfileMainContextSentinelState ¶
DockerfileMainContextSentinelState returns the synthetic MainContext state used by dockerBuild before llbtodagger rebinding.
Types ¶
type DefinitionToIDOptions ¶
type DefinitionToIDOptions struct {
// MainContextDirectoryID rebinding target for dockerBuild sentinel local
// source vertices emitted by Dockerfile2LLB when MainContext is synthetic.
MainContextDirectoryID *call.ID
// SecretIDsByLLBID maps BuildKit LLB secret IDs (for example Dockerfile
// secret mount ids) to Dagger Secret IDs used by withSecretVariable /
// withMountedSecret conversion.
SecretIDsByLLBID map[string]*call.ID
// SSHSocketIDsByLLBID maps BuildKit LLB ssh IDs to Dagger Socket IDs used
// by withUnixSocket conversion. A mapping for the empty key ("") acts as a
// default fallback for any unmatched ssh ID.
SSHSocketIDsByLLBID map[string]*call.ID
// NoInit applies `withExec(noInit: true)` to converted ExecOps. This is
// used by dockerBuild(noInit=true) cutover wiring.
NoInit bool
}
DefinitionToIDOptions controls optional conversion behavior for specific callsites (for example dockerBuild context rebinding).
type UnsupportedOpError ¶
UnsupportedOpError is returned when an LLB op cannot be mapped faithfully to a Dagger API ID.
func (*UnsupportedOpError) Error ¶
func (e *UnsupportedOpError) Error() string