dockerfrom

package
v4.24.7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dockerfrom reads the structure of a Dockerfile that container curation needs: each stage's FROM (as written and with ARG defaults applied), which stage is the final one, and the package-manager install lines in each stage's RUN instructions, with their line numbers.

It is not a Dockerfile interpreter. Build arguments passed on the command line are unknown, so a FROM that depends on an ARG without a default is reported as unresolved rather than guessed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Install

type Install struct {
	Line     int
	Manager  string
	Packages []Package
}

Install is one package-manager install command.

type Package

type Package struct {
	Name string
	// Spec is the argument as written (curl=8.5.0-r0) when it pins a version.
	Spec string
}

Package is a package as the command wrote it.

type Stage

type Stage struct {
	Index int
	// Name is the AS alias, lowercased as Docker treats it.
	Name   string
	Line   int
	RawRef string
	// ResolvedRef has ARG defaults applied; empty when the stage starts from an
	// earlier stage or an ARG has no default.
	ResolvedRef    string
	FromStage      string
	Platform       string
	IsFinal        bool
	UnresolvedArgs bool
	Installs       []Install
}

Stage is one FROM and what follows it until the next.

func Parse

func Parse(r io.Reader) []Stage

Parse reads a Dockerfile.

Jump to

Keyboard shortcuts

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