distro

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 12 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)
	},
}

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

	// PackageName returns the package name string that can be used in HashOpts.FilterByName.
	PackageName(sp filespec.FileSpec) (string, error)

	// IsPackageVersionInstalled checks that the package with the specified version is installed.
	IsPackageVersionInstalled(ctx context.Context, sp filespec.FileSpec) (bool, 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 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 InstallOpts

type InstallOpts struct {
}

Directories

Path Synopsis
distroutil

Jump to

Keyboard shortcuts

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