This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated libcontainer subpackage dependencies. Most subpackages now do…
… not depend on their parent ('libcontainer') package. 'namespaces' and 'nsinit' still do. 'namespaces' need to refactored a bit more to move the API part of it to 'libcontainer' package and keep the namespace specific code inside that package. This change is not expected to break docker. Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
- Loading branch information
Showing
21 changed files
with
375 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package mount | ||
|
||
import ( | ||
"errors" | ||
"github.com/docker/libcontainer/devices" | ||
) | ||
|
||
type MountSpec struct { | ||
// NoPivotRoot will use MS_MOVE and a chroot to jail the process into the container's rootfs | ||
// This is a common option when the container is running in ramdisk | ||
NoPivotRoot bool `json:"no_pivot_root,omitempty"` | ||
|
||
// ReadonlyFs will remount the container's rootfs as readonly where only externally mounted | ||
// bind mounts are writtable | ||
ReadonlyFs bool `json:"readonly_fs,omitempty"` | ||
|
||
// Mounts specify additional source and destination paths that will be mounted inside the container's | ||
// rootfs and mount namespace if specified | ||
Mounts Mounts `json:"mounts,omitempty"` | ||
|
||
// The device nodes that should be automatically created within the container upon container start. Note, make sure that the node is marked as allowed in the cgroup as well! | ||
DeviceNodes []*devices.Device `json:"device_nodes,omitempty"` | ||
|
||
MountLabel string | ||
} | ||
|
||
type Mount struct { | ||
Type string `json:"type,omitempty"` | ||
Source string `json:"source,omitempty"` // Source path, in the host namespace | ||
Destination string `json:"destination,omitempty"` // Destination path, in the container | ||
Writable bool `json:"writable,omitempty"` | ||
Private bool `json:"private,omitempty"` | ||
} | ||
|
||
type Mounts []Mount | ||
|
||
var ErrUnsupported = errors.New("Unsupported method") | ||
|
||
func (s Mounts) OfType(t string) Mounts { | ||
out := Mounts{} | ||
for _, m := range s { | ||
if m.Type == t { | ||
out = append(out, m) | ||
} | ||
} | ||
return out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.