Documentation
¶
Index ¶
- func BindMount(source, target string, readOnly bool) error
- func CleanupMounts(path string) error
- func CopyDir(src, dst string) error
- func DevMount(target string) error
- func DevPtsMount(target string) error
- func EnsureMountedDir(source, target, fstype string, flags uintptr, data string) error
- func GenerateHostname(hostname string) string
- func GenerateHosts(hostname string, extraHosts map[string]string) string
- func GenerateResolvConf(dnsServers []string, searchDomains []string, options []string, ...) string
- func IsFuseOverlayfsAvailable() bool
- func IsFusermountAvailable() bool
- func MqueueMount(target string) error
- func PrepareRootfs(rootfs string, files map[string]string, user ...string) error
- func ProcMount(target string) error
- func ShmMount(target string, sizeBytes int64) error
- func SysMount(target string) error
- func TmpfsMount(target string, sizeBytes int64, mode uint32) error
- type OverlayFS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindMount ¶
BindMount creates a bind mount.
BUG-01 fix: the kernel ignores MS_RDONLY on the initial bind mount call. Making a bind mount read-only requires a second, separate mount call with MS_BIND | MS_REMOUNT | MS_RDONLY.
func CleanupMounts ¶
CleanupMounts unmounts all mounts recursively from a path.
func DevPtsMount ¶
DevPtsMount mounts /dev/pts inside a container.
func EnsureMountedDir ¶
EnsureMountedDir ensures a directory is mounted.
func GenerateHostname ¶
GenerateHostname generates a hostname file.
func GenerateHosts ¶
GenerateHosts generates a /etc/hosts file.
func GenerateResolvConf ¶
func GenerateResolvConf(dnsServers []string, searchDomains []string, options []string, internalDNS ...string) string
GenerateResolvConf generates a resolv.conf file. If internalDNS is provided, it is added as the first nameserver (containers use the internal DNS server for container name resolution). Port is stripped from nameserver addresses — resolv.conf does not support port-qualified nameservers.
func IsFuseOverlayfsAvailable ¶
func IsFuseOverlayfsAvailable() bool
IsFuseOverlayfsAvailable checks if fuse-overlayfs is installed.
func IsFusermountAvailable ¶
func IsFusermountAvailable() bool
IsFusermountAvailable checks if fusermount is available.
func MqueueMount ¶
MqueueMount mounts /dev/mqueue inside a container.
func PrepareRootfs ¶
PrepareRootfs prepares a rootfs directory with proper permissions.
Types ¶
type OverlayFS ¶
type OverlayFS struct {
// contains filtered or unexported fields
}
OverlayFS implements a rootless overlay filesystem using fuse-overlayfs.
func NewOverlayFS ¶
NewOverlayFS creates a new FUSE overlay filesystem manager.
func (*OverlayFS) UnmountForce ¶
UnmountForce force-unmounts a mount point.