container

package
v0.333.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoesExist

func DoesExist(ctx context.Context, name string, image optional.Option[string]) (bool, error)

func Exec

func Exec(ctx context.Context, name string, command ...string) error

Exec runs a command in the given container, stream to stderr. Return an error if the command fails.

func GetContainerPort

func GetContainerPort(ctx context.Context, name string, port int) (int, error)

GetContainerPort returns the host TCP port of the given container's exposed port.

func PollContainerHealth

func PollContainerHealth(ctx context.Context, containerName string, timeout time.Duration) error

PollContainerHealth polls the given container until it is healthy or the timeout is reached.

func Pull added in v0.217.5

func Pull(ctx context.Context, imageName string) error

Pull pulls the given image.

func Run

func Run(ctx context.Context, image, name string, hostPort, containerPort int, volume optional.Option[string]) error

Run starts a new detached container with the given image, name, port map, and (optional) volume mount.

func RunDB

func RunDB(ctx context.Context, name string, port int, image string) error

RunDB runs a new detached postgres container with the given name and exposed port.

func Start

func Start(ctx context.Context, name string) error

Start starts an existing container with the given name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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