distro

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DockerfileTemplateFuncMap = template.FuncMap{
	"join": strings.Join,
	"snippet": func(name string) (string, error) {
		switch name {
		case "fetch-repro-get":
			return dockerfileFetchReproGetSnippet, nil
		}
		return "", fmt.Errorf("unknown snippet name %q", name)
	},
}
View Source
var ErrNotImplemented = errors.New("the specified distro driver does not implement the requested feature")

Functions

This section is empty.

Types

type Distro

type Distro interface {
	// Info returns the distro driver info.
	Info() Info

	// GenerateHash generates hash files.
	GenerateHash(ctx context.Context, hw HashWriter, opts HashOpts) error

	// InspectFile inspects a file
	InspectFile(ctx context.Context, sp filespec.FileSpec, opts InspectFileOpts) (*FileInfo, error)

	// InstallPackages installs the packages. The packages must be cached.
	InstallPackages(ctx context.Context, c *cache.Cache, pkgs []filespec.FileSpec, opts InstallOpts) error

	// GenerateDockerfile generates dockerfiles.
	GenerateDockerfile(ctx context.Context, dir string, args DockerfileTemplateArgs, opts DockerfileOpts) error
}

Distro is a distro driver.

type DockerfileOpts

type DockerfileOpts struct {
	GenerateHash bool
}

type DockerfileTemplateArgs

type DockerfileTemplateArgs struct {
	BaseImage          string
	BaseImageOrig      string
	Packages           []string
	OCIArchDashVariant string
	Providers          []string

	ReproGetVersion string // e.g., "v0.1.0"
	ReproGetSHASHA  string // sha256sum of SHA256SUMS, e.g., "a23ee0e0a2a2e940809b968befc84aa928323c86d3f4eef1f1653c96c2861632" for https://github.com/reproducible-containers/repro-get/releases/download/v0.1.0/SHA256SUMS
}

func (*DockerfileTemplateArgs) WriteToFile

func (a *DockerfileTemplateArgs) WriteToFile(f, tmpl string) error

type FileInfo added in v0.2.0

type FileInfo struct {
	filespec.FileSpec
	IsPackage   bool
	IsAux       bool
	PackageName string
	Installed   *bool
}

type HashOpts

type HashOpts struct {
	FilterByName []string     // No filter when empty
	Cache        *cache.Cache // Used only if Info.CacheIsNeededForGeneratingHash is true
}

type HashWriter

type HashWriter func(sha256sum, filename string) error

func NewHashWriter

func NewHashWriter(w io.Writer) HashWriter

type Info

type Info struct {
	Name                           string   `json:"Name"` // "debian", "ubuntu", ...
	DefaultProviders               []string `json:"DefaultProviders"`
	Experimental                   bool     `json:"Experimental"`
	CacheIsNeededForGeneratingHash bool     `json:"-"` // Implementation detail, not exposed in the JSON
}

type InspectFileOpts added in v0.2.0

type InspectFileOpts struct {
	CheckInstalled bool // can be slow
}

type InstallOpts

type InstallOpts struct {
	AuxFiles []filespec.FileSpec
}

Directories

Path Synopsis
distroutil

Jump to

Keyboard shortcuts

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