docker

package
v3.7.4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerExec

func ContainerExec(container, user string, interactive bool, command ...string) error

ContainerExec runs a command inside a Docker container with standard I/O (os.Stdin/Stdout/Stderr).

func CreateProxyNetwork

func CreateProxyNetwork()

CreateProxyNetwork creates the shared network for proxy and project services

func CronExecute

func CronExecute(projectName string, flag, manual bool)

CronExecute starts or stops cron service in the container

func Down

func Down(projectName string, withVolumes bool)

Down stops project containers

func DownNginx

func DownNginx(force bool)

DownNginx stops and removes the nginx proxy container

func GetContainerName

func GetContainerName(projectConf map[string]string, projectName, service string) string

GetContainerName returns the full container name for a service

func IsTTYAvailable

func IsTTYAvailable() bool

IsTTYAvailable checks whether a TTY is available for docker exec. It respects the MADOCK_TTY_ENABLED env var (0=off, 1=on) and falls back to checking if stdin is a terminal.

func Kill

func Kill(projectName string)

Kill forcefully stops project containers

func NotifyExecDone

func NotifyExecDone(container string, command []string, execErr error)

NotifyExecDone notifies the interceptor that a command has completed. Call after PrepareContainerExec + cmd.Run().

func PrepareContainerExec

func PrepareContainerExec(container, user string, interactive bool, command ...string) (*exec.Cmd, error)

PrepareContainerExec creates a docker exec *exec.Cmd with interceptor support. Caller sets Stdin/Stdout/Stderr, calls cmd.Run(), then calls NotifyExecDone().

func ReloadNginx

func ReloadNginx()

ReloadNginx reloads the nginx configuration

func SetCommandInterceptor

func SetCommandInterceptor(i CommandInterceptor)

SetCommandInterceptor sets a custom interceptor for docker exec commands.

func StopNginx

func StopNginx(force bool)

StopNginx stops the nginx proxy container

func StopSnapshot

func StopSnapshot(projectName string)

StopSnapshot stops snapshot container

func UpNginx

func UpNginx(projectName string)

UpNginx starts the nginx proxy container

func UpNginxWithBuild

func UpNginxWithBuild(projectName string, force bool)

UpNginxWithBuild starts the nginx proxy container with optional rebuild

func UpProjectWithBuild

func UpProjectWithBuild(projectName string, withChown bool)

UpProjectWithBuild starts project containers with build

func UpSnapshot

func UpSnapshot(projectName string)

UpSnapshot starts snapshot container

func UpWithBuild

func UpWithBuild(projectName string, withChown bool)

UpWithBuild starts both nginx proxy and project containers with build

Types

type CommandInterceptor

type CommandInterceptor interface {
	BeforeExec(container string, command []string) ([]string, error)
	AfterExec(container string, command []string, execErr error)
}

CommandInterceptor allows enterprise to intercept docker exec commands for auditing, sanitization, or blocking dangerous patterns.

Jump to

Keyboard shortcuts

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