...

Source file src/github.com/opencontainers/runc/libcontainer/configs/mount.go

Documentation: github.com/opencontainers/runc/libcontainer/configs

     1  package configs
     2  
     3  import "golang.org/x/sys/unix"
     4  
     5  const (
     6  	// EXT_COPYUP is a directive to copy up the contents of a directory when
     7  	// a tmpfs is mounted over it.
     8  	EXT_COPYUP = 1 << iota //nolint:golint // ignore "don't use ALL_CAPS" warning
     9  )
    10  
    11  type Mount struct {
    12  	// Source path for the mount.
    13  	Source string `json:"source"`
    14  
    15  	// Destination path for the mount inside the container.
    16  	Destination string `json:"destination"`
    17  
    18  	// Device the mount is for.
    19  	Device string `json:"device"`
    20  
    21  	// Mount flags.
    22  	Flags int `json:"flags"`
    23  
    24  	// Propagation Flags
    25  	PropagationFlags []int `json:"propagation_flags"`
    26  
    27  	// Mount data applied to the mount.
    28  	Data string `json:"data"`
    29  
    30  	// Relabel source if set, "z" indicates shared, "Z" indicates unshared.
    31  	Relabel string `json:"relabel"`
    32  
    33  	// RecAttr represents mount properties to be applied recursively (AT_RECURSIVE), see mount_setattr(2).
    34  	RecAttr *unix.MountAttr `json:"rec_attr"`
    35  
    36  	// Extensions are additional flags that are specific to runc.
    37  	Extensions int `json:"extensions"`
    38  
    39  	// Optional Command to be run before Source is mounted.
    40  	PremountCmds []Command `json:"premount_cmds"`
    41  
    42  	// Optional Command to be run after Source is mounted.
    43  	PostmountCmds []Command `json:"postmount_cmds"`
    44  }
    45  
    46  func (m *Mount) IsBind() bool {
    47  	return m.Flags&unix.MS_BIND != 0
    48  }
    49  

View as plain text