Documentation ¶
Index ¶
- Variables
- func GenerateCertificates(dir string) error
- func GetAvailableImageID(ctx context.Context, image string, fe containerutil.ContainerFrontend) (string, error)
- func GetContainerIP(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, ...) (string, error)
- func GetContainerImageID(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (string, error)
- func GetDockerVersion(ctx context.Context, fe containerutil.ContainerFrontend) (string, error)
- func GetLogs(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, ...) (string, error)
- func GetSettingsHash(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (string, error)
- func IsStarted(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (bool, error)
- func MaybePull(ctx context.Context, console conslogging.ConsoleLogger, image string, ...) error
- func MaybeRestart(ctx context.Context, console conslogging.ConsoleLogger, ...) error
- func MaybeStart(ctx context.Context, console conslogging.ConsoleLogger, ...) (string, error)
- func NewClient(ctx context.Context, console conslogging.ConsoleLogger, ...) (*client.Client, error)
- func RemoveExited(ctx context.Context, fe containerutil.ContainerFrontend, containerName string) error
- func ResetCache(ctx context.Context, console conslogging.ConsoleLogger, ...) error
- func Start(ctx context.Context, console conslogging.ConsoleLogger, ...) error
- func Stop(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) error
- func WaitUntilStarted(ctx context.Context, console conslogging.ConsoleLogger, ...) error
- func WaitUntilStopped(ctx context.Context, containerName string, opTimeout time.Duration, ...) error
- type Settings
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBuildkitCrashed is an error returned when buildkit has terminated unexpectedly. ErrBuildkitCrashed = errors.New("buildkitd crashed") // ErrBuildkitStartFailure is an error returned when buildkit has failed to start in time. ErrBuildkitStartFailure = errors.New("buildkitd failed to start (in time)") )
Functions ¶
func GenerateCertificates ¶ added in v0.6.15
GenerateCertificates creates and saves a CA and certificates for both sides of an mTLS TCP connection.
func GetAvailableImageID ¶
func GetAvailableImageID(ctx context.Context, image string, fe containerutil.ContainerFrontend) (string, error)
GetAvailableImageID fetches the ID of the image buildkitd image available.
func GetContainerIP ¶ added in v0.3.13
func GetContainerIP(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, settings Settings) (string, error)
GetContainerIP returns the IP of the buildkit container.
func GetContainerImageID ¶
func GetContainerImageID(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (string, error)
GetContainerImageID fetches the ID of the image used for the running buildkitd container.
func GetDockerVersion ¶ added in v0.6.15
func GetDockerVersion(ctx context.Context, fe containerutil.ContainerFrontend) (string, error)
GetDockerVersion returns the docker version command output
func GetLogs ¶ added in v0.6.15
func GetLogs(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, settings Settings) (string, error)
GetLogs returns earthly-buildkitd logs
func GetSettingsHash ¶
func GetSettingsHash(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (string, error)
GetSettingsHash fetches the hash of the currently running buildkitd container.
func IsStarted ¶
func IsStarted(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (bool, error)
IsStarted checks if the buildkitd container has been started.
func MaybePull ¶ added in v0.6.15
func MaybePull(ctx context.Context, console conslogging.ConsoleLogger, image string, fe containerutil.ContainerFrontend) error
MaybePull checks whether an image is available locally and pulls it if it is not.
func MaybeRestart ¶
func MaybeRestart(ctx context.Context, console conslogging.ConsoleLogger, image, containerName string, fe containerutil.ContainerFrontend, settings Settings, opts ...client.ClientOpt) error
MaybeRestart checks whether the there is a different buildkitd image available locally or if settings of the current container are different from the provided settings. In either case, the container is restarted.
func MaybeStart ¶
func MaybeStart(ctx context.Context, console conslogging.ConsoleLogger, image, containerName string, fe containerutil.ContainerFrontend, settings Settings, opts ...client.ClientOpt) (string, error)
MaybeStart ensures that the buildkitd daemon is started. It returns the URL that can be used to connect to it.
func NewClient ¶
func NewClient(ctx context.Context, console conslogging.ConsoleLogger, image, containerName string, fe containerutil.ContainerFrontend, settings Settings, opts ...client.ClientOpt) (*client.Client, error)
NewClient returns a new buildkitd client, together with a boolean specifying whether the buildkit is local.
func RemoveExited ¶ added in v0.3.0
func RemoveExited(ctx context.Context, fe containerutil.ContainerFrontend, containerName string) error
RemoveExited removes any stopped or exited buildkitd containers
func ResetCache ¶
func ResetCache(ctx context.Context, console conslogging.ConsoleLogger, image, containerName string, fe containerutil.ContainerFrontend, settings Settings, opts ...client.ClientOpt) error
ResetCache restarts the buildkitd daemon with the reset command.
func Start ¶
func Start(ctx context.Context, console conslogging.ConsoleLogger, image, containerName string, fe containerutil.ContainerFrontend, settings Settings, reset bool) error
Start starts the buildkitd daemon.
func Stop ¶
func Stop(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) error
Stop stops the buildkitd container.
func WaitUntilStarted ¶
func WaitUntilStarted(ctx context.Context, console conslogging.ConsoleLogger, containerName, volumeName, address string, opTimeout time.Duration, fe containerutil.ContainerFrontend, opts ...client.ClientOpt) error
WaitUntilStarted waits until the buildkitd daemon has started and is healthy.
func WaitUntilStopped ¶
func WaitUntilStopped(ctx context.Context, containerName string, opTimeout time.Duration, fe containerutil.ContainerFrontend) error
WaitUntilStopped waits until the buildkitd daemon has stopped.
Types ¶
type Settings ¶
type Settings struct { CacheSizeMb int CacheSizePct int Debug bool BuildkitAddress string DebuggerAddress string LocalRegistryAddress string AdditionalArgs []string AdditionalConfig string CniMtu uint16 Timeout time.Duration `hash:"ignore"` TLSCA string ClientTLSCert string ClientTLSKey string ServerTLSCert string ServerTLSKey string UseTCP bool UseTLS bool VolumeName string IPTables string MaxParallelism int SatelliteName string `hash:"ignore"` SatelliteOrgID string `hash:"ignore"` SatelliteToken string `hash:"ignore"` }
Settings represents the buildkitd settings used to start up the daemon with.