Documentation ¶
Index ¶
- Constants
- Variables
- func CheckCompatibility(ctx context.Context, settings Settings) error
- func GetAvailableImageID(ctx context.Context, image string) (string, error)
- func GetContainerIP(ctx context.Context) (string, error)
- func GetContainerImageID(ctx context.Context) (string, error)
- func GetSettingsHash(ctx context.Context) (string, error)
- func IsStarted(ctx context.Context) (bool, error)
- func MaybeRestart(ctx context.Context, console conslogging.ConsoleLogger, image string, ...) error
- func MaybeStart(ctx context.Context, console conslogging.ConsoleLogger, image string, ...) (string, error)
- func NewClient(ctx context.Context, console conslogging.ConsoleLogger, image string, ...) (*client.Client, error)
- func RemoveExited(ctx context.Context) error
- func ResetCache(ctx context.Context, console conslogging.ConsoleLogger, image string, ...) error
- func Start(ctx context.Context, image string, settings Settings, reset bool) error
- func Stop(ctx context.Context) error
- func WaitUntilStarted(ctx context.Context, address string, opTimeout time.Duration) error
- func WaitUntilStopped(ctx context.Context, opTimeout time.Duration) error
- type Settings
Constants ¶
const ( // ContainerName is the name of the buildkitd container. ContainerName = "earthly-buildkitd" // VolumeName is the name of the docker volume used for storing the cache. VolumeName = "earthly-cache" )
Variables ¶
var Address = fmt.Sprintf("docker-container://%s", ContainerName)
Address is the address at which the daemon is available.
Functions ¶
func CheckCompatibility ¶ added in v0.4.0
CheckCompatibility runs all avaliable compatibility checks before starting the buildkitd daemon.
func GetAvailableImageID ¶
GetAvailableImageID fetches the ID of the image buildkitd image available.
func GetContainerIP ¶ added in v0.3.13
GetContainerIP returns the IP of the buildkit container.
func GetContainerImageID ¶
GetContainerImageID fetches the ID of the image used for the running buildkitd container.
func GetSettingsHash ¶
GetSettingsHash fetches the hash of the currently running buildkitd container.
func MaybeRestart ¶
func MaybeRestart(ctx context.Context, console conslogging.ConsoleLogger, image string, settings Settings, opTimeout time.Duration) 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 string, settings Settings, opTimeout time.Duration) (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 string, settings Settings, opTimeout time.Duration, opts ...client.ClientOpt) (*client.Client, error)
NewClient returns a new buildkitd client.
func RemoveExited ¶ added in v0.3.0
RemoveExited removes any stopped or exited buildkitd containers
func ResetCache ¶
func ResetCache(ctx context.Context, console conslogging.ConsoleLogger, image string, settings Settings, opTimeout time.Duration) error
ResetCache restarts the buildkitd daemon with the reset command.
func WaitUntilStarted ¶
WaitUntilStarted waits until the buildkitd daemon has started and is healthy.
Types ¶
type Settings ¶
type Settings struct { CacheSizeMb int `json:"cacheSizeMb"` GitURLInsteadOf string `json:"gitUrlInsteadOf"` RunDir string `json:"runDir"` Debug bool `json:"debug"` DebuggerPort int `json:"debuggerPort"` AdditionalArgs []string `json:"additionalArgs"` }
Settings represents the buildkitd settings used to start up the daemon with.