Documentation
¶
Index ¶
- func CopyToContainer(ctx context.Context, docker *client.Client, cid string, file struct{ ... }) error
- func ExecInContainer(ctx context.Context, docker *client.Client, cid string, cmd []string) (string, error)
- func Pointer[T any](value T) *T
- func RandomString(n int) string
- func ShortStr(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyToContainer ¶ added in v1.4.0
func CopyToContainer( ctx context.Context, docker *client.Client, cid string, file struct { Data []byte Path string // absolute path inside container, e.g. "/etc/postgresql-custom/postgresql.custom.conf" }, ) error
CopyToContainer copies a single file's contents into a docker container at file.Path. It creates any missing parent directories with mode 0755 and writes the file as 0644. Ownership will be the container default (usually root:root).
func ExecInContainer ¶
func ExecInContainer(ctx context.Context, docker *client.Client, cid string, cmd []string) (string, error)
ExecInContainer runs "cmd" inside container cid and streams output to stdout/stderr
func RandomString ¶
RandomString returns a secure random string of length n.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.