Documentation
¶
Overview ¶
Package cli provides the Doki command-line interface.
Index ¶
- func ValidateFlags(args []string, validFlags []string, valueFlags []string) error
- type DokiCLI
- func (c *DokiCLI) Apply(file string) error
- func (c *DokiCLI) Attach(containerID string, _ string, _ string) error
- func (c *DokiCLI) AutoUpdate() error
- func (c *DokiCLI) Build(contextDir, dokifile string, tags []string, buildArgs map[string]string, ...) error
- func (c *DokiCLI) Commit(_, repo, tag, author, _ string, pause bool, _ []string) error
- func (c *DokiCLI) Cp(containerID, srcPath, destPath string, _, _ bool) error
- func (c *DokiCLI) CpToContainer(containerID, srcPath, destPath string, _ bool, _ bool) error
- func (c *DokiCLI) Create(image string, cmd []string, opts *RunFlags) (string, error)
- func (c *DokiCLI) Diff(containerID string) error
- func (c *DokiCLI) Events(filter string) error
- func (c *DokiCLI) Exec(containerID string, cmd []string, tty, detach, interactive bool, env []string, ...) error
- func (c *DokiCLI) Export(containerID string, output string) error
- func (c *DokiCLI) GenerateKube(containerID string, _ bool) error
- func (c *DokiCLI) Healthcheck(containerID string) error
- func (c *DokiCLI) History(imageName string, noTrunc, _ bool) error
- func (c *DokiCLI) Images(all, quiet, noTrunc bool, filter string) error
- func (c *DokiCLI) ImagesPrune(_ bool, _ string) error
- func (c *DokiCLI) Import(source, repo, tag string, _ []string, _ string) error
- func (c *DokiCLI) Inspect(containerIDs []string, format string) error
- func (c *DokiCLI) Kill(ids []string, signal string) error
- func (c *DokiCLI) KubeDown(file string) error
- func (c *DokiCLI) KubeGenerate(what string) error
- func (c *DokiCLI) KubePlay(file string) error
- func (c *DokiCLI) LinkAdd(id, addr, pubB64 string) error
- func (c *DokiCLI) LinkRemove(id string) error
- func (c *DokiCLI) LinkShow() error
- func (c *DokiCLI) Load(input string, quiet bool) error
- func (c *DokiCLI) Login(server, username, password string) error
- func (c *DokiCLI) Logout(_ string) error
- func (c *DokiCLI) Logs(containerID string, follow, timestamps bool, tail int, _ string) error
- func (c *DokiCLI) MeshLs() error
- func (c *DokiCLI) MeshStatus() error
- func (c *DokiCLI) Mount(_ []string) error
- func (c *DokiCLI) NetworkConnect(networkID, containerID string, aliases []string) error
- func (c *DokiCLI) NetworkCreate(name, driver string, internal, ipv6 bool, subnet, gateway string, ...) error
- func (c *DokiCLI) NetworkDisconnect(networkID, containerID string, force bool) error
- func (c *DokiCLI) NetworkInspect(ids []string) error
- func (c *DokiCLI) NetworkLs(_ bool, _ bool, _ string, _ string) error
- func (c *DokiCLI) NetworkPrune(_ string) error
- func (c *DokiCLI) NetworkRm(ids []string) error
- func (c *DokiCLI) Pause(ids []string) error
- func (c *DokiCLI) Ping() error
- func (c *DokiCLI) PodCreate(name string, labels map[string]string) (string, error)
- func (c *DokiCLI) PodPs() error
- func (c *DokiCLI) PodRm(ids []string, force bool) error
- func (c *DokiCLI) PodStart(ids []string) error
- func (c *DokiCLI) PodStop(ids []string) error
- func (c *DokiCLI) Port(containerID, privatePort string) error
- func (c *DokiCLI) Prune(_ bool, _ string) error
- func (c *DokiCLI) Ps(all, quiet, noTrunc bool, filter, format string, _ int, _ bool) error
- func (c *DokiCLI) Pull(imageName string, _ bool, quiet bool) error
- func (c *DokiCLI) Push(imageName string, allTags, quiet bool) error
- func (c *DokiCLI) Rename(containerID, newName string) error
- func (c *DokiCLI) Restart(ids []string, timeout int) error
- func (c *DokiCLI) Rm(ids []string, force, volumes, _ bool) error
- func (c *DokiCLI) Rmi(ids []string, force, _ bool) error
- func (c *DokiCLI) Run(args []string) error
- func (c *DokiCLI) Save(imageNames []string, output string) error
- func (c *DokiCLI) Scout(_ string) error
- func (c *DokiCLI) Search(term string, limit int, _ bool, _ int) error
- func (c *DokiCLI) Start(ids []string) error
- func (c *DokiCLI) Stats(containerIDs []string, noStream bool) error
- func (c *DokiCLI) Stop(ids []string, timeout int) error
- func (c *DokiCLI) SystemDf(verbose bool) error
- func (c *DokiCLI) SystemDialStdio() error
- func (c *DokiCLI) SystemEvents(_ string, _ string, _ string) error
- func (c *DokiCLI) SystemInfo() error
- func (c *DokiCLI) SystemPrune(all, volumes bool, _ string) error
- func (c *DokiCLI) SystemVersion() error
- func (c *DokiCLI) Tag(source, target string) error
- func (c *DokiCLI) Top(containerID string, psArgs string) error
- func (c *DokiCLI) Unmount(_ []string) error
- func (c *DokiCLI) Unpause(ids []string) error
- func (c *DokiCLI) Unshare(_ []string) error
- func (c *DokiCLI) Untag(_ string) error
- func (c *DokiCLI) Update(containerID string, flags *RunFlags) error
- func (c *DokiCLI) VerifyImageSignature(imageName string) error
- func (c *DokiCLI) VolumeCreate(name, driver string, opts, labels map[string]string) error
- func (c *DokiCLI) VolumeInspect(ids []string) error
- func (c *DokiCLI) VolumeLs(_ bool, _ string) error
- func (c *DokiCLI) VolumePrune(_ string) error
- func (c *DokiCLI) VolumeRm(ids []string, _ bool) error
- func (c *DokiCLI) Wait(containerID string) (int, error)
- type ExitError
- type MountOpt
- type RunFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateFlags ¶ added in v0.10.0
ValidateFlags returns an error if args contains any token starting with "-" that is not listed in validFlags. Flags in valueFlags consume the next token as their value, and that token is not inspected. The first unknown flag triggers the returned error, formatted as "invalid flag: <flag>".
Types ¶
type DokiCLI ¶
type DokiCLI struct {
// contains filtered or unexported fields
}
DokiCLI is the Doki command-line client that communicates with the Doki daemon via Unix socket.
func (*DokiCLI) AutoUpdate ¶
AutoUpdate checks for and applies image updates to containers.
func (*DokiCLI) Build ¶
func (c *DokiCLI) Build(contextDir, dokifile string, tags []string, buildArgs map[string]string, noCache, pull, quiet, rm bool, target string) error
Build builds an image from a Dockerfile.
func (*DokiCLI) CpToContainer ¶
CpToContainer copies files from the local filesystem into a container.
func (*DokiCLI) Exec ¶
func (c *DokiCLI) Exec(containerID string, cmd []string, tty, detach, interactive bool, env []string, workdir, user string) error
Exec runs a command inside an existing container.
func (*DokiCLI) GenerateKube ¶
GenerateKube generates Kubernetes YAML from containers or pods.
func (*DokiCLI) Healthcheck ¶
Healthcheck shows the health status of a container.
func (*DokiCLI) ImagesPrune ¶
ImagesPrune removes unused images.
func (*DokiCLI) Inspect ¶
Inspect returns detailed information about containers or images in JSON format.
func (*DokiCLI) KubeGenerate ¶
KubeGenerate generates Kubernetes YAML for a given resource type.
func (*DokiCLI) LinkRemove ¶ added in v0.9.3
LinkRemove removes a peer from the static list.
func (*DokiCLI) MeshStatus ¶ added in v0.9.3
MeshStatus returns the local mesh install id and CA fingerprint.
func (*DokiCLI) NetworkConnect ¶
NetworkConnect connects a container to a network.
func (*DokiCLI) NetworkCreate ¶
func (c *DokiCLI) NetworkCreate(name, driver string, internal, ipv6 bool, subnet, gateway string, _ map[string]string) error
NetworkCreate creates a new network.
func (*DokiCLI) NetworkDisconnect ¶
NetworkDisconnect disconnects a container from a network.
func (*DokiCLI) NetworkInspect ¶
NetworkInspect shows detailed information about networks.
func (*DokiCLI) NetworkPrune ¶
NetworkPrune removes all unused networks.
func (*DokiCLI) Run ¶
Run creates and starts a new container from an image with the given arguments and flags.
func (*DokiCLI) SystemDialStdio ¶
SystemDialStdio connects stdin/stdout to the daemon.
func (*DokiCLI) SystemEvents ¶
SystemEvents streams real-time events from the daemon.
func (*DokiCLI) SystemInfo ¶
SystemInfo displays system-wide information.
func (*DokiCLI) SystemPrune ¶
SystemPrune removes unused containers, images, and optionally volumes.
func (*DokiCLI) SystemVersion ¶
SystemVersion shows the Doki version information.
func (*DokiCLI) VerifyImageSignature ¶
VerifyImageSignature checks if an image has a valid signature.
func (*DokiCLI) VolumeCreate ¶
VolumeCreate creates a new volume.
func (*DokiCLI) VolumeInspect ¶
VolumeInspect shows detailed information about volumes.
func (*DokiCLI) VolumePrune ¶
VolumePrune removes all unused volumes.
type ExitError ¶ added in v0.10.0
type ExitError struct {
Code int
}
ExitError signals that the invoked process (typically a container) terminated with the given exit code. Callers (cmd/doki/main.go) detect this type via errors.As and propagate the code to os.Exit, so library code in pkg/ never calls os.Exit directly.
type RunFlags ¶
type RunFlags struct {
Name string
Detach bool
Interactive bool
TTY bool
RM bool
Privileged bool
ReadOnly bool
Network string
RestartPolicy string
Memory int64
MemorySwap int64
NanoCPUs int64
CPUSetCPUs string
CPUSetMems string
CPUPeriod int64
CPUQuota int64
PidsLimit int64
OOMKillDisable bool
ShmSize int64
DNS []string
DNSSearch []string
DNSOptions []string
ExtraHosts []string
Env []string
EnvFile []string
Workdir string
User string
Entrypoint string
StopSignal string
StopTimeout int
Init bool
Pull string
Platform string
CapAdd []string
CapDrop []string
SecurityOpt []string
Sysctls map[string]string
Ulimits []string
LogDriver string
LogOpts map[string]string
Ports []string
PublishAll bool
Volumes []string
Mounts []MountOpt
Devices []string
DeviceCgroupRules []string
GroupAdd []string
Hostname string
Domainname string
IP string
IP6 string
Link []string
LinkLocalIP string
MACAddress string
BlkioWeight uint16
CgroupParent string
CgroupNS string
IPCMode string
PIDMode string
UTSMode string
UsernsMode string
Isolation string
Runtime_RT string
StorageOpt map[string]string
VolumeDriver string
VolumesFrom []string
Expose []string
Labels map[string]string
LabelFile []string
Annotations map[string]string
HealthCmd string
HealthInterval string
HealthTimeout string
HealthRetries int
HealthStartPeriod string
GPUs string
}
RunFlags holds all the flags accepted by the run command.