Documentation
¶
Index ¶
- Constants
- Variables
- func AddEnv(env []string, name, value string) []string
- func LookupEnv(env []string, name string) (string, bool)
- func WalkEnv(env []string, fn func(string, string, string))
- type AliasSet
- type BuildArg
- type CacheID
- type CacheMap
- type CacheSharingMode
- type CacheVolume
- type Container
- func (container *Container) Build(ctx context.Context, context *Directory, dockerfile string, ...) (*Container, error)
- func (container *Container) Clone() *Container
- func (container *Container) Digest() (digest.Digest, error)
- func (container *Container) Directory(ctx context.Context, bk *buildkit.Client, svcs *Services, dirPath string) (*Directory, error)
- func (container *Container) Evaluate(ctx context.Context, bk *buildkit.Client, svcs *Services) error
- func (container *Container) Export(ctx context.Context, bk *buildkit.Client, svcs *Services, dest string, ...) error
- func (container *Container) FSState() (llb.State, error)
- func (container *Container) File(ctx context.Context, bk *buildkit.Client, svcs *Services, filePath string) (*File, error)
- func (container *Container) From(ctx context.Context, bk *buildkit.Client, addr string) (*Container, error)
- func (container *Container) ID() (ContainerID, error)
- func (container *Container) ImageConfig(ctx context.Context) (specs.ImageConfig, error)
- func (container *Container) ImageRefOrErr(ctx context.Context, bk *buildkit.Client) (string, error)
- func (container *Container) Import(ctx context.Context, source FileID, tag string, bk *buildkit.Client, ...) (*Container, error)
- func (container *Container) MetaFileContents(ctx context.Context, bk *buildkit.Client, svcs *Services, progSock string, ...) (string, error)
- func (container *Container) MetaState() (*llb.State, error)
- func (container *Container) MountTargets(ctx context.Context) ([]string, error)
- func (container *Container) PipelinePath() pipeline.Path
- func (container *Container) Publish(ctx context.Context, bk *buildkit.Client, svcs *Services, ref string, ...) (string, error)
- func (container *Container) RootFS(ctx context.Context) (*Directory, error)
- func (container *Container) Service(ctx context.Context, bk *buildkit.Client, progSock string) (*Service, error)
- func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error)
- func (container *Container) WithDirectory(ctx context.Context, bk *buildkit.Client, subdir string, src *Directory, ...) (*Container, error)
- func (container *Container) WithExec(ctx context.Context, bk *buildkit.Client, progSock string, ...) (*Container, error)
- func (container *Container) WithExposedPort(port Port) (*Container, error)
- func (container *Container) WithFile(ctx context.Context, bk *buildkit.Client, destPath string, src *File, ...) (*Container, error)
- func (container *Container) WithMountedCache(ctx context.Context, bk *buildkit.Client, target string, cache *CacheVolume, ...) (*Container, error)
- func (container *Container) WithMountedDirectory(ctx context.Context, bk *buildkit.Client, target string, dir *Directory, ...) (*Container, error)
- func (container *Container) WithMountedFile(ctx context.Context, bk *buildkit.Client, target string, file *File, ...) (*Container, error)
- func (container *Container) WithMountedSecret(ctx context.Context, bk *buildkit.Client, target string, source *Secret, ...) (*Container, error)
- func (container *Container) WithMountedTemp(ctx context.Context, target string) (*Container, error)
- func (container *Container) WithNewFile(ctx context.Context, bk *buildkit.Client, dest string, content []byte, ...) (*Container, error)
- func (container *Container) WithPipeline(ctx context.Context, name, description string, labels []pipeline.Label) (*Container, error)
- func (container *Container) WithRootFS(ctx context.Context, dir *Directory) (*Container, error)
- func (container *Container) WithSecretVariable(ctx context.Context, name string, secret *Secret) (*Container, error)
- func (container *Container) WithServiceBinding(ctx context.Context, svcs *Services, svc *Service, alias string) (*Container, error)
- func (container *Container) WithUnixSocket(ctx context.Context, bk *buildkit.Client, target string, source *socket.Socket, ...) (*Container, error)
- func (container *Container) WithoutExposedPort(port int, protocol NetworkProtocol) (*Container, error)
- func (container *Container) WithoutMount(ctx context.Context, target string) (*Container, error)
- func (container *Container) WithoutUnixSocket(ctx context.Context, target string) (*Container, error)
- type ContainerExecOpts
- type ContainerExecUncachedMetadata
- type ContainerID
- type ContainerMount
- type ContainerMounts
- type ContainerSecret
- type ContainerSocket
- type Context
- type CopyFilter
- type Digestible
- type Directory
- func NewDirectory(ctx context.Context, def *pb.Definition, dir string, pipeline pipeline.Path, ...) *Directory
- func NewDirectorySt(ctx context.Context, st llb.State, dir string, pipeline pipeline.Path, ...) (*Directory, error)
- func NewScratchDirectory(pipeline pipeline.Path, platform specs.Platform) *Directory
- func (dir *Directory) Clone() *Directory
- func (dir *Directory) Diff(ctx context.Context, other *Directory) (*Directory, error)
- func (dir *Directory) Digest() (digest.Digest, error)
- func (dir *Directory) Directory(ctx context.Context, bk *buildkit.Client, svcs *Services, subdir string) (*Directory, error)
- func (dir *Directory) Entries(ctx context.Context, bk *buildkit.Client, svcs *Services, src string) ([]string, error)
- func (dir *Directory) Evaluate(ctx context.Context, bk *buildkit.Client, svcs *Services) error
- func (dir *Directory) Export(ctx context.Context, bk *buildkit.Client, host *Host, svcs *Services, ...) (rerr error)
- func (dir *Directory) File(ctx context.Context, bk *buildkit.Client, svcs *Services, file string) (*File, error)
- func (dir *Directory) ID() (DirectoryID, error)
- func (dir *Directory) PipelinePath() pipeline.Path
- func (dir *Directory) Root() (*Directory, error)
- func (dir *Directory) SetState(ctx context.Context, st llb.State) error
- func (dir *Directory) Stat(ctx context.Context, bk *buildkit.Client, svcs *Services, src string) (*fstypes.Stat, error)
- func (dir *Directory) State() (llb.State, error)
- func (dir *Directory) StateWithSourcePath() (llb.State, error)
- func (dir *Directory) WithDirectory(ctx context.Context, destDir string, src *Directory, filter CopyFilter, ...) (*Directory, error)
- func (dir *Directory) WithFile(ctx context.Context, destPath string, src *File, permissions fs.FileMode, ...) (*Directory, error)
- func (dir *Directory) WithNewDirectory(ctx context.Context, dest string, permissions fs.FileMode) (*Directory, error)
- func (dir *Directory) WithNewFile(ctx context.Context, dest string, content []byte, permissions fs.FileMode, ...) (*Directory, error)
- func (dir *Directory) WithPipeline(ctx context.Context, name, description string, labels []pipeline.Label) (*Directory, error)
- func (dir *Directory) WithTimestamps(ctx context.Context, unix int) (*Directory, error)
- func (dir *Directory) Without(ctx context.Context, path string) (*Directory, error)
- type DirectoryID
- type File
- func (file *File) Clone() *File
- func (file *File) Contents(ctx context.Context, bk *buildkit.Client, svcs *Services) ([]byte, error)
- func (file *File) Digest() (digest.Digest, error)
- func (file *File) Evaluate(ctx context.Context, bk *buildkit.Client, svcs *Services) error
- func (file *File) Export(ctx context.Context, bk *buildkit.Client, host *Host, svcs *Services, ...) error
- func (file *File) ID() (FileID, error)
- func (file *File) Open(ctx context.Context, host *Host, bk *buildkit.Client, svcs *Services) (io.ReadCloser, error)
- func (file *File) PipelinePath() pipeline.Path
- func (file *File) Stat(ctx context.Context, bk *buildkit.Client, svcs *Services) (*fstypes.Stat, error)
- func (file *File) State() (llb.State, error)
- func (file *File) WithTimestamps(ctx context.Context, unix int) (*File, error)
- type FileID
- type Host
- func (host *Host) Directory(ctx context.Context, bk *buildkit.Client, dirPath string, p pipeline.Path, ...) (*Directory, error)
- func (host *Host) File(ctx context.Context, bk *buildkit.Client, svcs *Services, path string, ...) (*File, error)
- func (host *Host) Socket(ctx context.Context, sockPath string) (*socket.Socket, error)
- type ImageLayerCompression
- type ImageMediaTypes
- type NetworkProtocol
- type Ownership
- type Port
- type Project
- type ProjectCommand
- type ProjectCommandFlag
- type ProjectCommandID
- type ProjectID
- type Query
- type Resolver
- type RunningService
- type Secret
- type SecretID
- type SecretStore
- type SecretToScrubInfo
- type Service
- func (svc *Service) Clone() *Service
- func (svc *Service) Digest() (digest.Digest, error)
- func (svc *Service) Endpoint(ctx context.Context, svcs *Services, port int, scheme string) (string, error)
- func (svc *Service) Hostname(ctx context.Context, svcs *Services) (string, error)
- func (svc *Service) ID() (ServiceID, error)
- func (svc *Service) PipelinePath() pipeline.Path
- func (svc *Service) Ports(ctx context.Context, svcs *Services) ([]Port, error)
- func (svc *Service) Start(ctx context.Context, bk *buildkit.Client, svcs *Services) (running *RunningService, err error)
- type ServiceBinding
- type ServiceBindings
- type ServiceID
- type ServiceKey
- type Services
- func (ss *Services) Detach(ctx context.Context, svc *RunningService) error
- func (ss *Services) Get(ctx context.Context, svc Startable) (*RunningService, error)
- func (ss *Services) Start(ctx context.Context, svc Startable) (*RunningService, error)
- func (ss *Services) StartBindings(ctx context.Context, bk *buildkit.Client, bindings ServiceBindings) (_ func(), _ []*RunningService, err error)
- func (ss *Services) Stop(ctx context.Context, bk *buildkit.Client, svc *Service) error
- func (ss *Services) StopClientServices(ctx context.Context, client *engine.ClientMetadata) error
- type Startable
Constants ¶
const DetachGracePeriod = 10 * time.Second
DetachGracePeriod is an arbitrary amount of time between when a service is no longer actively used and before it is detached. This is to avoid repeated stopping and re-starting of the same service in rapid succession.
Variables ¶
var ErrContainerNoExec = errors.New("no command has been executed")
var ErrInvalidCacheID = errors.New("invalid cache ID; create one using cacheVolume")
var ErrNotFound = errors.New("secret not found")
ErrNotFound indicates a secret can not be found.
Functions ¶
Types ¶
type CacheID ¶
type CacheID string
CacheID is an arbitrary string typically derived from a set of token strings acting as the cache's "key" or "scope".
func (CacheID) ToCacheVolume ¶ added in v0.5.1
func (id CacheID) ToCacheVolume() (*CacheVolume, error)
type CacheMap ¶ added in v0.8.0
type CacheMap[K comparable, T any] struct { // contains filtered or unexported fields }
func NewCacheMap ¶ added in v0.8.0
func NewCacheMap[K comparable, T any]() *CacheMap[K, T]
func (*CacheMap[K, T]) GetOrInitialize ¶ added in v0.8.0
type CacheSharingMode ¶ added in v0.3.12
type CacheSharingMode string
CacheSharingMode is a string deriving from CacheSharingMode enum it can take values: SHARED, PRIVATE, LOCKED
const ( CacheSharingModePrivate CacheSharingMode = "PRIVATE" CacheSharingModeLocked CacheSharingMode = "LOCKED" )
type CacheVolume ¶
type CacheVolume struct {
Keys []string `json:"keys"`
}
CacheVolume is a persistent volume with a globally scoped identifier.
func NewCache ¶
func NewCache(keys ...string) *CacheVolume
func (*CacheVolume) Clone ¶ added in v0.5.1
func (cache *CacheVolume) Clone() *CacheVolume
func (*CacheVolume) ID ¶
func (cache *CacheVolume) ID() (CacheID, error)
func (*CacheVolume) Sum ¶ added in v0.5.1
func (cache *CacheVolume) Sum() string
Sum returns a checksum of the cache tokens suitable for use as a cache key.
func (*CacheVolume) WithKey ¶
func (cache *CacheVolume) WithKey(key string) *CacheVolume
type Container ¶
type Container struct { // The container's root filesystem. FS *pb.Definition `json:"fs"` // Image configuration (env, workdir, etc) Config specs.ImageConfig `json:"cfg"` // Pipeline Pipeline pipeline.Path `json:"pipeline"` // Mount points configured for the container. Mounts ContainerMounts `json:"mounts,omitempty"` // Meta is the /dagger filesystem. It will be null if nothing has run yet. Meta *pb.Definition `json:"meta,omitempty"` // The platform of the container's rootfs. Platform specs.Platform `json:"platform,omitempty"` // Secrets to expose to the container. Secrets []ContainerSecret `json:"secret_env,omitempty"` // Sockets to expose to the container. Sockets []ContainerSocket `json:"sockets,omitempty"` // Image reference ImageRef string `json:"image_ref,omitempty"` // Ports to expose from the container. Ports []Port `json:"ports,omitempty"` // Services to start before running the container. Services ServiceBindings `json:"services,omitempty"` // Focused indicates whether subsequent operations will be // focused, i.e. shown more prominently in the UI. Focused bool `json:"focused"` }
Container is a content-addressed container.
func NewContainer ¶ added in v0.3.3
func (*Container) Clone ¶ added in v0.5.1
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*Container) Export ¶ added in v0.3.3
func (container *Container) Export( ctx context.Context, bk *buildkit.Client, svcs *Services, dest string, platformVariants []ContainerID, forcedCompression ImageLayerCompression, mediaTypes ImageMediaTypes, ) error
func (*Container) FSState ¶ added in v0.5.1
FSState returns the container's root filesystem mount state. If there is none (as with an empty container ID), it returns scratch.
func (*Container) ID ¶
func (container *Container) ID() (ContainerID, error)
ID marshals the container into a content-addressed ID.
func (*Container) ImageConfig ¶
func (*Container) ImageRefOrErr ¶ added in v0.5.1
func (*Container) MetaFileContents ¶ added in v0.3.5
func (*Container) MetaState ¶ added in v0.5.1
MetaState returns the container's metadata mount state. If the container has yet to run, it returns nil.
func (*Container) MountTargets ¶ added in v0.5.1
func (*Container) PipelinePath ¶ added in v0.5.2
PipelinePath returns the container's pipeline path.
func (*Container) Publish ¶
func (container *Container) Publish( ctx context.Context, bk *buildkit.Client, svcs *Services, ref string, platformVariants []ContainerID, forcedCompression ImageLayerCompression, mediaTypes ImageMediaTypes, ) (string, error)
func (*Container) UpdateImageConfig ¶
func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error)
func (*Container) WithDirectory ¶ added in v0.3.7
func (*Container) WithExposedPort ¶ added in v0.3.13
func (*Container) WithMountedCache ¶
func (*Container) WithMountedDirectory ¶
func (*Container) WithMountedFile ¶
func (*Container) WithMountedSecret ¶
func (*Container) WithMountedTemp ¶
func (*Container) WithNewFile ¶ added in v0.3.7
func (*Container) WithPipeline ¶ added in v0.5.1
func (*Container) WithRootFS ¶ added in v0.3.5
func (*Container) WithSecretVariable ¶
func (*Container) WithServiceBinding ¶ added in v0.5.0
func (*Container) WithUnixSocket ¶ added in v0.3.7
func (*Container) WithoutExposedPort ¶ added in v0.3.13
func (container *Container) WithoutExposedPort(port int, protocol NetworkProtocol) (*Container, error)
func (*Container) WithoutMount ¶
type ContainerExecOpts ¶
type ContainerExecOpts struct { // Command to run instead of the container's default command Args []string // If the container has an entrypoint, ignore it for this exec rather than // calling it with args. SkipEntrypoint bool // Content to write to the command's standard input before closing Stdin string // Redirect the command's standard output to a file in the container RedirectStdout string // Redirect the command's standard error to a file in the container RedirectStderr string // Provide dagger access to the executed command // Do not use this option unless you trust the command being executed. // The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM ExperimentalPrivilegedNesting bool // Grant the process all root capabilities InsecureRootCapabilities bool }
type ContainerExecUncachedMetadata ¶ added in v0.8.0
type ContainerExecUncachedMetadata struct { ParentClientIDs []string `json:"parentClientIDs,omitempty"` ServerID string `json:"serverID,omitempty"` ProgSockPath string `json:"progSockPath,omitempty"` }
Metadata passed to an exec that doesn't count towards the cache key. This should be used with great caution; only for metadata that is safe to be de-duplicated across execs.
Currently, this uses the FTPProxy LLB option to pass without becoming part of the cache key. This is a hack that, while ugly to look at, is simple and robust. Alternatives would be to use secrets or sockets, but they are more complicated, or to create a custom buildkit worker/executor, which is MUCH more complicated.
If a need to add ftp proxy support arises, then we can just also embed the "real" ftp proxy setting in here too and have the shim handle leaving only that set in the actual env var.
func (*ContainerExecUncachedMetadata) FromEnv ¶ added in v0.8.0
func (md *ContainerExecUncachedMetadata) FromEnv(envKV string) (bool, error)
func (ContainerExecUncachedMetadata) ToEnv ¶ added in v0.8.5
func (md ContainerExecUncachedMetadata) ToEnv() ([]string, error)
func (ContainerExecUncachedMetadata) ToLLBRunOpt ¶ added in v0.8.0
func (md ContainerExecUncachedMetadata) ToLLBRunOpt() (llb.RunOption, error)
type ContainerID ¶
type ContainerID string
ContainerID is an opaque value representing a content-addressed container.
func (ContainerID) Digest ¶ added in v0.5.2
func (id ContainerID) Digest() (digest.Digest, error)
func (ContainerID) String ¶ added in v0.3.13
func (id ContainerID) String() string
func (ContainerID) ToContainer ¶ added in v0.5.1
func (id ContainerID) ToContainer() (*Container, error)
type ContainerMount ¶
type ContainerMount struct { // The source of the mount. Source *pb.Definition `json:"source,omitempty"` // A path beneath the source to scope the mount to. SourcePath string `json:"source_path,omitempty"` // The path of the mount within the container. Target string `json:"target"` // Persist changes to the mount under this cache ID. CacheID string `json:"cache_id,omitempty"` // How to share the cache across concurrent runs. CacheSharingMode string `json:"cache_sharing,omitempty"` // Configure the mount as a tmpfs. Tmpfs bool `json:"tmpfs,omitempty"` }
ContainerMount is a mount point configured in a container.
func (ContainerMount) SourceState ¶
func (mnt ContainerMount) SourceState() (llb.State, error)
SourceState returns the state of the source of the mount.
type ContainerMounts ¶ added in v0.3.3
type ContainerMounts []ContainerMount
func (ContainerMounts) With ¶ added in v0.3.3
func (mnts ContainerMounts) With(newMnt ContainerMount) ContainerMounts
type ContainerSecret ¶
type ContainerSecret struct { Secret SecretID `json:"secret"` EnvName string `json:"env,omitempty"` MountPath string `json:"path,omitempty"` Owner *Ownership `json:"owner,omitempty"` Mode *int `json:"mode,omitempty"` }
ContainerSecret configures a secret to expose, either as an environment variable or mounted to a file path.
type ContainerSocket ¶ added in v0.3.7
type ContainerSocket struct { SocketID socket.ID `json:"socket"` UnixPath string `json:"unix_path,omitempty"` Owner *Ownership `json:"owner,omitempty"` }
ContainerSocket configures a socket to expose, currently as a Unix socket, but potentially as a TCP or UDP address in the future.
type Context ¶ added in v0.8.0
type Context struct { context.Context ResolveParams graphql.ResolveParams // Vertex is a recorder for sending logs to the request's vertex in the // progress stream. Vertex *progrock.VertexRecorder }
type CopyFilter ¶ added in v0.3.3
type Digestible ¶ added in v0.8.0
type Digestible interface {
Digest() (digest.Digest, error)
}
Digestible is any object which can return a digest of its content.
It is used to record the request's result as an output of the request's vertex in the progress stream.
type Directory ¶
type Directory struct { LLB *pb.Definition `json:"llb"` Dir string `json:"dir"` Platform specs.Platform `json:"platform"` Pipeline pipeline.Path `json:"pipeline"` // Services necessary to provision the directory. Services ServiceBindings `json:"services,omitempty"` }
Directory is a content-addressed directory.
func NewDirectory ¶
func NewDirectorySt ¶ added in v0.5.2
func NewScratchDirectory ¶ added in v0.6.3
func (*Directory) Clone ¶ added in v0.5.1
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*Directory) ID ¶
func (dir *Directory) ID() (DirectoryID, error)
ID marshals the directory into a content-addressed ID.
func (*Directory) PipelinePath ¶ added in v0.5.2
func (*Directory) StateWithSourcePath ¶ added in v0.5.1
func (*Directory) WithDirectory ¶
func (*Directory) WithNewDirectory ¶ added in v0.3.3
func (*Directory) WithNewFile ¶
func (*Directory) WithPipeline ¶ added in v0.5.1
func (*Directory) WithTimestamps ¶ added in v0.3.8
type DirectoryID ¶
type DirectoryID string
DirectoryID is an opaque value representing a content-addressed directory.
func (DirectoryID) Digest ¶ added in v0.5.2
func (id DirectoryID) Digest() (digest.Digest, error)
func (DirectoryID) String ¶ added in v0.5.2
func (id DirectoryID) String() string
func (DirectoryID) ToDirectory ¶ added in v0.5.1
func (id DirectoryID) ToDirectory() (*Directory, error)
ToDirectory converts the ID into a real Directory.
type File ¶
type File struct { LLB *pb.Definition `json:"llb"` File string `json:"file"` Pipeline pipeline.Path `json:"pipeline"` Platform specs.Platform `json:"platform"` // Services necessary to provision the file. Services ServiceBindings `json:"services,omitempty"` }
File is a content-addressed file.
func (*File) Clone ¶ added in v0.5.1
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*File) Contents ¶
func (file *File) Contents(ctx context.Context, bk *buildkit.Client, svcs *Services) ([]byte, error)
Contents handles file content retrieval
func (*File) PipelinePath ¶ added in v0.5.2
type Host ¶ added in v0.3.3
type Host struct { }
type ImageLayerCompression ¶ added in v0.5.3
type ImageLayerCompression string
const ( CompressionGzip ImageLayerCompression = "Gzip" CompressionZstd ImageLayerCompression = "Zstd" CompressionEStarGZ ImageLayerCompression = "EStarGZ" CompressionUncompressed ImageLayerCompression = "Uncompressed" )
type ImageMediaTypes ¶ added in v0.6.4
type ImageMediaTypes string
const ( OCIMediaTypes ImageMediaTypes = "OCIMediaTypes" DockerMediaTypes ImageMediaTypes = "DockerMediaTypes" )
type NetworkProtocol ¶ added in v0.3.13
type NetworkProtocol string
NetworkProtocol is a string deriving from NetworkProtocol enum
const ( NetworkProtocolTCP NetworkProtocol = "TCP" NetworkProtocolUDP NetworkProtocol = "UDP" )
func (NetworkProtocol) EnumName ¶ added in v0.8.5
func (proto NetworkProtocol) EnumName() string
func (NetworkProtocol) Network ¶ added in v0.3.13
func (proto NetworkProtocol) Network() string
Network returns the value appropriate for the "network" argument to Go net.Dial, and for appending to the port number to form the key for the ExposedPorts object in the OCI image config.
type Ownership ¶ added in v0.5.1
Ownership contains a UID/GID pair resolved from a user/group name or ID pair provided via the API. It primarily exists to distinguish an unspecified ownership from UID/GID 0 (root) ownership.
func (Ownership) Opt ¶ added in v0.5.1
func (owner Ownership) Opt() llb.ChownOption
type Port ¶ added in v0.8.5
type Port struct { Port int `json:"port"` Protocol NetworkProtocol `json:"protocol"` Description *string `json:"description,omitempty"` }
Port configures a port to exposed from a container or service.
type Project ¶ added in v0.5.3
type Project struct { // The project's root directory Directory *Directory `json:"directory"` // Path to the project's config file relative to the root directory ConfigPath string `json:"configPath"` // The parsed project config Config projectconfig.Config `json:"config"` // The graphql schema for the project Schema string `json:"schema"` // The project's platform Platform specs.Platform `json:"platform,omitempty"` }
func NewProject ¶ added in v0.5.3
type ProjectCommand ¶ added in v0.5.3
type ProjectCommand struct { Name string `json:"name"` Flags []ProjectCommandFlag `json:"flags"` ResultType string `json:"resultType"` Description string `json:"description"` Subcommands []ProjectCommand `json:"subcommands"` }
func NewProjectCommand ¶ added in v0.5.3
func NewProjectCommand(id ProjectCommandID) (*ProjectCommand, error)
func (*ProjectCommand) ID ¶ added in v0.5.3
func (p *ProjectCommand) ID() (ProjectCommandID, error)
type ProjectCommandFlag ¶ added in v0.5.3
type ProjectCommandID ¶ added in v0.5.3
type ProjectCommandID string
func (ProjectCommandID) String ¶ added in v0.5.3
func (id ProjectCommandID) String() string
func (ProjectCommandID) ToProjectCommand ¶ added in v0.5.3
func (id ProjectCommandID) ToProjectCommand() (*ProjectCommand, error)
type Query ¶ added in v0.3.10
func (*Query) PipelinePath ¶ added in v0.4.0
type RunningService ¶ added in v0.8.5
type RunningService struct { // Key is the unique identifier for the service. Key ServiceKey // Host is the hostname used to reach the service. Host string // Ports lists the ports bound by the service. // // For a Container service, this is simply the list of exposed ports. // // For a TunnelService, this lists the configured port forwards with any // empty or 0 frontend ports resolved to their randomly selected host port. // // For a HostService, this lists the configured port forwards with any empty // or 0 frontend ports set to the same as the backend port. Ports []Port // Stop forcibly stops the service. It is normally called after all clients // have detached, but may also be called manually by the user. Stop func(context.Context) error }
RunningService represents a service that is actively running.
type Secret ¶
type Secret struct { // Name specifies the arbitrary name/id of the secret. Name string `json:"name,omitempty"` }
Secret is a content-addressed secret.
func NewDynamicSecret ¶ added in v0.5.1
type SecretID ¶
type SecretID string
SecretID is an opaque value representing a content-addressed secret.
type SecretStore ¶ added in v0.8.0
type SecretStore struct {
// contains filtered or unexported fields
}
func NewSecretStore ¶ added in v0.8.0
func NewSecretStore() *SecretStore
func (*SecretStore) AddSecret ¶ added in v0.8.0
func (store *SecretStore) AddSecret(_ context.Context, name string, plaintext []byte) (SecretID, error)
AddSecret adds the secret identified by user defined name with its plaintext value to the secret store.
func (*SecretStore) GetSecret ¶ added in v0.8.0
GetSecret returns the plaintext secret value.
Its argument may either be the user defined name originally specified within a SecretID, or a full SecretID value.
A user defined name will be received when secrets are used in a Dockerfile build.
In all other cases, a SecretID is expected.
func (*SecretStore) SetBuildkitClient ¶ added in v0.8.0
func (store *SecretStore) SetBuildkitClient(bk *buildkit.Client)
type SecretToScrubInfo ¶ added in v0.3.13
type SecretToScrubInfo struct { // Envs stores environment variable names that we need to scrub. Envs []string `json:"envs,omitempty"` // Files stores secret file paths that we need to scrub. Files []string `json:"files,omitempty"` }
SecretToScrubInfo stores the info to access secrets and scrub them from outputs.
type Service ¶ added in v0.3.13
type Service struct { // Container is the container to run as a service. Container *Container `json:"container"` }
func NewContainerService ¶ added in v0.8.5
func (*Service) Clone ¶ added in v0.8.5
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*Service) PipelinePath ¶ added in v0.8.5
PipelinePath returns the service's pipeline path.
type ServiceBinding ¶ added in v0.8.5
type ServiceBindings ¶ added in v0.3.13
type ServiceBindings []ServiceBinding
func (*ServiceBindings) Merge ¶ added in v0.3.13
func (bndp *ServiceBindings) Merge(other ServiceBindings)
type ServiceKey ¶ added in v0.8.5
type ServiceKey struct { Digest digest.Digest ClientID string }
ServiceKey is a unique identifier for a service.
type Services ¶ added in v0.8.5
type Services struct {
// contains filtered or unexported fields
}
Services manages the lifecycle of services, ensuring the same service only runs once per client.
func NewServices ¶ added in v0.8.5
NewServices returns a new Services.
func (*Services) Detach ¶ added in v0.8.5
func (ss *Services) Detach(ctx context.Context, svc *RunningService) error
Detach detaches from the given service. If the service is not running, it is a no-op. If the service is running, it is stopped if there are no other clients using it.
func (*Services) Get ¶ added in v0.8.5
Get returns the running service for the given service. If the service is starting, it waits for it and either returns the running service or an error if it failed to start. If the service is not running or starting, an error is returned.
func (*Services) Start ¶ added in v0.8.5
Start starts the given service, returning the running service. If the service is already running, it is returned immediately. If the service is already starting, it waits for it to finish and returns the running service. If the service failed to start, it tries again.
func (*Services) StartBindings ¶ added in v0.8.5
func (ss *Services) StartBindings(ctx context.Context, bk *buildkit.Client, bindings ServiceBindings) (_ func(), _ []*RunningService, err error)
StartBindings starts each of the bound services in parallel and returns a function that will detach from all of them after 10 seconds.
func (*Services) Stop ¶ added in v0.8.5
Stop stops the given service. If the service is not running, it is a no-op.
func (*Services) StopClientServices ¶ added in v0.8.5
StopClientServices stops all of the services being run by the given client. It is called when a client is closing.