Documentation
¶
Index ¶
- func InsideContainer() bool
- type Attach
- type Podman
- func (e *Podman) Copy(args []string, attach Attach) *exec.Cmd
- func (e *Podman) Create(args []string, attach Attach) *exec.Cmd
- func (e *Podman) Exec(args []string, sh bool, root bool, attach Attach) *exec.Cmd
- func (e *Podman) Exists(name string) bool
- func (e *Podman) IsDocker() bool
- func (e *Podman) RawCommand(args []string, attach Attach) *exec.Cmd
- func (e *Podman) Remove(args []string, attach Attach) error
- func (e *Podman) Start(args []string, attach Attach) error
- func (e *Podman) Stop(args []string, attach Attach) error
- func (e *Podman) Version() ([]int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InsideContainer ¶
func InsideContainer() bool
Checks if we are inside a container
To do this we check the /run directory for .containerenv (podman) or .dockerenv (docker)
Types ¶
type Podman ¶
type Podman struct {
// contains filtered or unexported fields
}
func (*Podman) Exec ¶
Executes a command inside a running container and attaches (Stdin, Stdout) if "attach" is true.
func (*Podman) IsDocker ¶
Checks if the path contains the word "docker"
Mainly here so we can make this work on docker too.
func (*Podman) RawCommand ¶
Runs any podman subcommand (for example: ps)
func (*Podman) Remove ¶
Removes a container and returns an error in case of failure.
In arguments, the first argument can should the container's name/id if no flag are added before of the name.
func (*Podman) Start ¶
Starts a container and returns an error in case of failure.
In arguments, the first argument should probably be the container's name/id.