Documentation
¶
Overview ¶
Package hostenv tells whether mutti runs inside a container and maps paths of that container to paths on the Docker host, which is what the daemon needs for bind mounts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerSocket ¶
DockerSocket returns the Docker socket's path on the Docker host, for containers that talk to Docker: $MUTTI_DOCKER_SOCKET if set (needed where mutti itself runs in a container), else the path of a unix daemon address like unix:///run/user/1000/docker.sock, else the default.
func SelfContainer ¶
SelfContainer returns the id of the container mutti runs in, or ok=false on a plain host. The id comes from /proc/self/mountinfo, where Docker's per-container files show up; the hostname, Docker's default for it, is the fallback.
Types ¶
type PathMap ¶
type PathMap struct {
// contains filtered or unexported fields
}
PathMap translates paths inside this container to paths on the Docker host.
func NewPathMap ¶
NewPathMap builds a map from the container's mounts. Extra pairs (container path -> host path) win over the mounts, for runners that know better, like CI systems.