dinkerlib

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: ISC Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImage

func BuildImage(args BuildImageArgs) (hash string, err error)

func Def

func Def[T comparable](v T, alt T) T

Types

type AbsPath

type AbsPath string

func MakeAbsPath added in v0.0.4

func MakeAbsPath(relOrAbs string) AbsPath

func (*AbsPath) Exists

func (p *AbsPath) Exists() bool

func (AbsPath) Filename

func (p AbsPath) Filename() string

func (AbsPath) Join

func (p AbsPath) Join(rel string) AbsPath

func (AbsPath) Parent

func (p AbsPath) Parent() AbsPath

func (AbsPath) Raw

func (p AbsPath) Raw() string

func (AbsPath) String

func (p AbsPath) String() string

func (*AbsPath) UnmarshalText

func (s *AbsPath) UnmarshalText(text []byte) error

During json unmarshaling, relative paths are based on the working directory of dinker

type BuildImageArgs

type BuildImageArgs struct {
	// optional, if zero then "scratch" (no base layers, need Architecture and Os below)
	FromPath AbsPath
	// Defaults to FROM image architecture
	Architecture string
	// Defaults to FROM image os
	Os string
	// Directories to build in the image root
	Dirs []BuildImageArgsDir
	// Files to add to the image root
	Files []BuildImageArgsFile
	// Don't inherit env from FROM image
	ClearEnv bool
	AddEnv   map[string]string
	// Defaults to FROM image working dir
	WorkingDir string
	// Defaults to FROM image user
	User       string
	Entrypoint []string
	Cmd        []string
	Ports      []BuildImageArgsPort
	StopSignal string
	Labels     map[string]string
	/// Where to place the built image as an oci-dir
	DestDirPath AbsPath
}

type BuildImageArgsDir added in v0.1.0

type BuildImageArgsDir struct {
	// Name in parent in destination tree
	Name string `json:"name"`
	// Parsed as octal, defaults to 0755
	Mode string `json:"mode"`
	// Child dirs
	Dirs []BuildImageArgsDir
	// Child files
	Files []BuildImageArgsFile
}

type BuildImageArgsFile

type BuildImageArgsFile struct {
	// Name in parent in destination tree. Defaults to filename of source if empty.
	Name string `json:"name"`
	// Path of file to copy from
	Source AbsPath `json:"source"`
	// Parsed as octal, defaults to 0644
	Mode string `json:"mode"`
}

type BuildImageArgsPort

type BuildImageArgsPort struct {
	Port int `json:"port"`
	// `tcp` or `udp`, defaults to `tcp`
	Transport string `json:"transport"`
}

Jump to

Keyboard shortcuts

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