exec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package exec provides options for the compose exec command

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCommand

func WithCommand(command ...string) compose.SetComposeExecOption

WithCommand sets the command and arguments (required), e.g. WithCommand("sh", "-c", "echo hi")

func WithDetach

func WithDetach() compose.SetComposeExecOption

WithDetach runs the command in the background

func WithEnv

func WithEnv(keyValue ...string) compose.SetComposeExecOption

WithEnv sets environment variables (key=value), can be used multiple times

func WithIndex

func WithIndex(index int) compose.SetComposeExecOption

WithIndex sets the index of the container when the service has multiple replicas

func WithNoTTY

func WithNoTTY() compose.SetComposeExecOption

WithNoTTY disables pseudo-TTY allocation (use for scripts or piping)

func WithPrivileged

func WithPrivileged() compose.SetComposeExecOption

WithPrivileged gives extended privileges to the process

func WithProfiles

func WithProfiles(profiles ...string) compose.SetComposeExecOption

WithProfiles sets the profiles to activate

func WithService

func WithService(service string) compose.SetComposeExecOption

WithService sets the service name (required)

func WithStdin

WithStdin sets the reader to forward to the container (e.g. os.Stdin for interactive)

func WithUser

func WithUser(user string) compose.SetComposeExecOption

WithUser runs the command as this user (e.g. "root", "1000:1000")

func WithWorkdir

func WithWorkdir(dir string) compose.SetComposeExecOption

WithWorkdir sets the working directory for the command

func WithWriter

func WithWriter(writer io.Writer) compose.SetComposeExecOption

WithWriter sets the writer for stdout/stderr

Types

This section is empty.

Jump to

Keyboard shortcuts

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