container

package
v0.237.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 14 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) (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, image 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) 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