A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/moby/buildkit/client/llb below:

llb package - github.com/moby/buildkit/client/llb - Go Packages

View Source
const (
	GitAuthTokenKey  = "GIT_AUTH_TOKEN"
)
View Source
var (
	LinuxAmd64   = Platform(ocispecs.Platform{OS: "linux", Architecture: "amd64"})
	LinuxArmhf   = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm", Variant: "v7"})
	LinuxArm     = LinuxArmhf
	LinuxArmel   = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm", Variant: "v6"})
	LinuxArm64   = Platform(ocispecs.Platform{OS: "linux", Architecture: "arm64"})
	LinuxS390x   = Platform(ocispecs.Platform{OS: "linux", Architecture: "s390x"})
	LinuxPpc64   = Platform(ocispecs.Platform{OS: "linux", Architecture: "ppc64"})
	LinuxPpc64le = Platform(ocispecs.Platform{OS: "linux", Architecture: "ppc64le"})
	Darwin       = Platform(ocispecs.Platform{OS: "darwin", Architecture: "amd64"})
	Windows      = Platform(ocispecs.Platform{OS: "windows", Architecture: "amd64"})
)
View Source
var MarkImageInternal = imageOptionFunc(func(ii *ImageInfo) {
	ii.RecordType = "internal"
})
func ForceNoOutput(m *mount)

AuthOption can be used with either HTTP or Git sources.

AuthHeaderSecret returns an AuthOption that defines the name of a secret to use for HTTP based authentication.

type CDIDeviceInfo struct {
	Name     string
	Optional bool
}
type CDIDeviceOption interface {
	SetCDIDeviceOption(*CDIDeviceInfo)
}
type CacheMountSharingMode int

WithCaps exposes supported LLB caps to the marshaler

WithExportCache forces results for this vertex to be exported with the cache

WithoutDefaultExportCache resets the cache export for the vertex to use the default defined by the build configuration.

WithoutExportCache sets results for this vertex to be not exported with the cache

type CopyInput interface {
	
}

CopyInput is either llb.State or *FileActionWithState It is used by Copy to to specify the source of the copy operation.

type CopyOption interface {
	SetCopyOption(*CopyInfo)
}

Definition is the LLB definition structure with per-vertex metadata entries Corresponds to the Definition structure defined in solver/pb.Definition.

type DefinitionOp struct {
	
}

DefinitionOp implements llb.Vertex using a marshalled definition.

For example, after marshalling a LLB state and sending over the wire, the LLB state can be reconstructed from the definition.

NewDefinitionOp returns a new operation from a marshalled definition.

type ExecState struct {
	State
	
}
type FileAction struct {
	
}

FileAction is used to specify a file operation on a State. It can be used to create a directory, create a file, or remove a file, etc. This is used by State.File Typically a FileAction is created by calling one of the helper functions such as Mkdir, Copy, Rm, Mkfile

Copy produces a FileAction which copies a file or directory from the source to the destination. The "input" parameter is the contents to copy from. "src" is the path to copy from within the "input". "dest" is the path to copy to within the destination (the state being operated on). See CopyInput for the valid types of input.

Example:

st := llb.Local(".")
llb.Scratch().File(llb.Copy(st, "/foo", "/bar"))

The example copies the local (client) directory "./foo" to a new empty directory at /bar.

Note: Copying directories can have different behavior based on if the destination exists or not. When the destination already exists, the contents of the source directory is copied underneath the destination, including the directory itself. You may need to supply a copy option to copy the dir contents only. You may also need to pass in a CopyOption which creates parent directories if they do not exist.

See CopyOption for more details on what options are available.

Mkdir creates a FileAction which creates a directory at the given path. Example:

llb.Scratch().File(llb.Mkdir("/foo", 0755))

Mkfile creates a FileAction which creates a file at the given path with the provided contents. Example:

llb.Scratch().File(llb.Mkfile("/foo", 0644, []byte("hello world!")))

Rm creates a FileAction which removes a file or directory at the given path. Example:

llb.Scratch().File(Mkfile("/foo", 0644, []byte("not around for long..."))).File(llb.Rm("/foo"))

Symlink creates a symlink at `newpath` that points to `oldpath`

Symlink creates a symlink at `newpath` that points to `oldpath`

type GitOption interface {
	SetGitOption(*GitInfo)
}
type HTTPHeader struct {
}
type HTTPOption interface {
	SetHTTPOption(*HTTPInfo)
}

Header returns an HTTPOption that ensures additional request headers will be sent when retrieving the HTTP source.

type ImageInfo struct {
	RecordType string
	
}

ImageMetaResolver can resolve image config metadata from a reference

type ImageOption interface {
	SetImageOption(*ImageInfo)
}

ResolveDigest uses the meta resolver to update the ref of image with full digest before marshaling. This makes image ref immutable and is recommended if you want to make sure meta resolver data matches the image used during the build.

WithMetaResolver adds a metadata resolver to an image

type LocalOption interface {
	SetLocalOption(*LocalInfo)
}
type MarshalCache struct {
	
}
type MkdirOption interface {
	SetMkdirOption(*MkdirInfo)
}

WithParents is an option for Mkdir which creates parent directories if they do not exist.

type MkfileOption interface {
	SetMkfileOption(*MkfileInfo)
}
type MountContentCache int
type MountOption func(*mount)
type OCILayoutInfo struct {
	
}
type OCILayoutOption interface {
	SetOCILayoutOption(*OCILayoutInfo)
}
type OpMetadata struct {
	IgnoreCache   bool                   `json:"ignore_cache,omitempty"`
	Description   map[string]string      `json:"description,omitempty"`
	ExportCache   *pb.ExportCache        `json:"export_cache,omitempty"`
	Caps          map[apicaps.CapID]bool `json:"caps,omitempty"`
	ProgressGroup *pb.ProgressGroup      `json:"progress_group,omitempty"`
}

OpMetadata has a more friendly interface for pb.OpMetadata.

const (
	ResolveModeDefault ResolveMode = iota
	ResolveModeForcePull
	ResolveModePreferLocal
)
type RmInfo struct {
	AllowNotFound bool
	AllowWildcard bool
}
type RmOption interface {
	SetRmOption(*RmInfo)
}
type RunOption interface {
	SetRunOption(es *ExecInfo)
}

AddSecret is a RunOption that adds a secret to the exec.

AddSecretWithDest is a RunOption that adds a secret to the exec with an optional destination.

ReadonlyRootFS sets the execs's root filesystem to be read-only.

WithProxy is a RunOption that sets the proxy environment variables in the resulting exec. For example `HTTP_PROXY` is a standard environment variable for unix systems that programs may read.

type SSHOption interface {
	SetSSHOption(*SSHInfo)
}
type SecretOption interface {
	SetSecretOption(*SecretInfo)
}

SecretAsEnv defines if the secret should be added as an environment variable

SecretAsEnvName defines if the secret should be added as an environment variable with the specified name

SecretFileOpt sets the secret's target file uid, gid and permissions.

SourceMap maps a source file/location to an LLB state/definition. SourceMaps are used to provide information for debugging and helpful error messages to the user. As an example, lets say you have a Dockerfile with the following content:

FROM alpine
RUN exit 1

When the "RUN" statement exits with a non-zero exit code buildkit will treat it as an error and is able to provide the user with a helpful error message pointing to exactly the line in the Dockerfile that caused the error.

State represents all operations that must be done to produce a given output. States are immutable, and all operations return a new state linked to the previous one. State is the core type of the LLB API and is used to build a graph of operations. The graph is then marshaled into a definition that can be executed by a backend (such as buildkitd).

Operations performed on a State are executed lazily after the entire state graph is marshalled and sent to the backend.

Diff returns a state that represents the diff of the lower and upper states. The returned State is useful for use with Merge where you can merge the lower state with the diff.

Git returns a state that represents a git repository. Example:

st := llb.Git("https://github.com/moby/buildkit.git", "v0.11.6")

The example fetches the v0.11.6 tag of the buildkit repository. You can also use a commit hash or a branch name.

Other URL formats are supported such as "git@github.com:moby/buildkit.git", "git://...", "ssh://..." Formats that utilize SSH may need to supply credentials as a GitOption. You may need to check the source code for a full list of supported formats.

By default the git repository is cloned with `--depth=1` to reduce the amount of data downloaded. Additionally the ".git" directory is removed after the clone, you can keep ith with the KeepGitDir GitOption.

Image returns a state that represents a docker image in a registry. Example:

st := llb.Image("busybox:latest")

Local returns a state that represents a directory local to the client.

Merge merges multiple states into a single state. This is useful in conjunction with Diff to create set of patches which are independent of each other to a base state without affecting the cache of other merged states. As an example, lets say you have a rootfs with the following directories:

/ /bin /etc /opt /tmp

Now lets say you want to copy a directory /etc/foo from one state and a binary /bin/bar from another state. Copy makes a duplicate of file on top of another directory. Merge creates a directory whose contents is an overlay of 2 states on top of each other.

With "Merge" you can do this:

fooState := Diff(rootfs, fooState)
barState := Diff(rootfs, barState)

Then merge the results with:

Merge(rootfs, fooDiff, barDiff)

The resulting state will have both /etc/foo and /bin/bar, but because Merge was used, changing the contents of "fooDiff" does not require copying "barDiff" again.

Scratch returns a state that represents an empty filesystem.

AddEnv returns a new State with the provided environment variable set. See AddEnv

AddEnvf is the same as State.AddEnv but with a format string.

AddExtraHost adds a host name to IP mapping to any containers created from this state.

AddUlimit sets the hard/soft for the given ulimit. The ulimit is applied to containers created from this state. Ulimits are Linux specific and only applies to containers created from this state such as via `[State.Run]` Ulimits do not apply to image configs.

Dir returns a new State with the provided working directory set. See Dir

Dirf is the same as State.Dir but with a format string.

Env returns a new State with the provided environment variable set. See [Env]

File performs a file operation on the current state. See FileAction for details on the operations that can be performed.

GetDir returns the current working directory for the state.

GetEnv returns the value of the environment variable with the provided key.

GetHostname returns the hostname set on the state. See Hostname for more details.

GetNetwork returns the network mode for the state.

GetPlatform returns the platform for the state.

GetSecurity returns the security mode for the state.

Hostname sets the hostname for this state. See Hostname for more details.

Marshal marshals the state and all its parents into a Definition.

Network sets the network mode for the state. Network modes are used by State.Run to determine the network mode used when running the container. Network modes are not applied to image configs.

Output returns the output of the state.

Platform sets the platform for the state. Platforms are used to determine image variants to pull and run as well as the platform metadata to set on the image config.

Reset is used to return a new State with all of the current state and the provided State as the parent. In effect you can think of this as creating a new state with all the output from the current state but reparented to the provided state. See Reset for more details.

Run performs the command specified by the arguments within the context of the current State. The command is executed as a container with the State's filesystem as the root filesystem. As such any command you run must be present in the State's filesystem. Constraints such as [State.Ulimit], [State.ParentCgroup], State.Network, etc. are applied to the container.

Run is useful when none of the LLB ops are sufficient for the operation that you want to perform.

Security sets the security mode for the state. Security modes are used by State.Run to the privileges that processes in the container will run with. Security modes are not applied to image configs.

User sets the user for this state. See User for more details.

Validate validates the state. This validation, unlike most other operations on State, is not lazily performed.

With applies [StateOption]s to the State. Each applied StateOption creates a new State object with the previous as its parent.

WithCgroupParent sets the parent cgroup for any containers created from this state. This is useful when you want to apply resource constraints to a group of containers. Cgroups are Linux specific and only applies to containers created from this state such as via `[State.Run]` Cgroups do not apply to image configs.

WithImageConfig adds the environment variables, working directory, and platform specified in the image config to the state.

WithOutput creates a new state with the output set to the given output.

AddEnv returns a StateOption whichs adds an environment variable to the state. Use this with State.With to create a new state with the environment variable set. This is the equivalent of `[State.AddEnv]`

AddEnvf is the same as AddEnv but allows for a format string. This is the equivalent of `[State.AddEnvf]`

Dir returns a StateOption sets the working directory for the state which will be used to resolve relative paths as well as the working directory for State.Run. See State.With for where to use this.

Dirf is the same as Dir but allows for a format string.

SymlinkInfo is the modifiable options used to create symlinks

type SymlinkOption interface {
	SetSymlinkOption(*SymlinkInfo)
}
type TmpfsInfo struct {
	Size int64
}
type TmpfsOption interface {
	SetTmpfsOption(*TmpfsInfo)
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4