dockerfile

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitSourceRef

type GitSourceRef struct {
	// URL is the Git URL as it appears in the Dockerfile (e.g., https://github.com/owner/repo.git#ref)
	URL string
	// Line is the line number in the Dockerfile where this reference appears
	Line int
}

GitSourceRef represents a Git source reference extracted from a Dockerfile ADD instruction. BuildKit supports git URLs in ADD instructions for fetching repositories during build.

type HTTPSourceRef

type HTTPSourceRef struct {
	// URL is the HTTP/HTTPS URL as it appears in the Dockerfile
	URL string
	// Line is the line number in the Dockerfile where this reference appears
	Line int
}

HTTPSourceRef represents an HTTP/HTTPS source reference extracted from a Dockerfile ADD instruction. Note: ADD instructions with --checksum flag are excluded (already pinned).

type ImageRef

type ImageRef struct {
	// Original is the original image reference as it appears in the Dockerfile
	Original string
	// Ref is the parsed and normalized reference
	Ref reference.Named
	// Line is the line number in the Dockerfile where this reference appears
	Line int
	// StageName is the build stage name if this is a named stage
	StageName string
}

ImageRef represents a container image reference extracted from a Dockerfile

func Parse

func Parse(ctx context.Context, r io.Reader) ([]ImageRef, error)

Parse parses a Dockerfile from a reader and extracts all image references

func ParseFile

func ParseFile(ctx context.Context, path string) ([]ImageRef, error)

ParseFile parses a Dockerfile and extracts all image references

type ParseResult

type ParseResult struct {
	// Images contains all container image references (FROM and COPY --from instructions)
	Images []ImageRef
	// HTTPSources contains all HTTP/HTTPS source references (ADD instructions without checksum)
	HTTPSources []HTTPSourceRef
	// GitSources contains all Git source references (ADD instructions)
	GitSources []GitSourceRef
}

ParseResult contains all extracted references from a Dockerfile

func ParseAll

func ParseAll(ctx context.Context, r io.Reader) (*ParseResult, error)

ParseAll parses a Dockerfile from a reader and extracts all references

func ParseAllFile

func ParseAllFile(ctx context.Context, path string) (*ParseResult, error)

ParseAllFile parses a Dockerfile and extracts all references (images and HTTP sources)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL