summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-05-01 12:08:52 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-03 12:23:12 +0000
commitab7e2a695633dbe45b0af3332b813b0efdfbf203 (patch)
tree74de1a9b76fbc3ab628f083561ed60c2576836be /libpod/container.go
parent16c997de624be049dda5d2182ec70d979194b002 (diff)
downloadpodman-ab7e2a695633dbe45b0af3332b813b0efdfbf203.tar.gz
podman-ab7e2a695633dbe45b0af3332b813b0efdfbf203.tar.bz2
podman-ab7e2a695633dbe45b0af3332b813b0efdfbf203.zip
Store user Volumes, Entrypoint, Command in database
We need these for commit, and they cannot be properly deduced from just the OCI spec, so save them in the database so we can retrieve them for commit. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #700 Approved by: rhatdan
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go46
1 files changed, 32 insertions, 14 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 67aa086fc..f70856d67 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -174,28 +174,26 @@ type ContainerConfig struct {
// TODO consider breaking these subsections up into smaller structs
// Storage Config
- // Information on the image used for the root filesystem
+
+ // Information on the image used for the root filesystem/
RootfsImageID string `json:"rootfsImageID,omitempty"`
RootfsImageName string `json:"rootfsImageName,omitempty"`
- // Whether to mount volumes specified in the image
+ // Whether to mount volumes specified in the image.
ImageVolumes bool `json:"imageVolumes"`
- // Src path to be mounted on /dev/shm in container
+ // Src path to be mounted on /dev/shm in container.
ShmDir string `json:"ShmDir,omitempty"`
- // Size of the container's SHM
+ // Size of the container's SHM.
ShmSize int64 `json:"shmSize"`
// Static directory for container content that will persist across
- // reboot
+ // reboot.
StaticDir string `json:"staticDir"`
- // Mounts list contains all additional mounts into the container rootfs
- // These include the SHM mount
- // These must be unmounted before the container's rootfs is unmounted
+ // Mounts list contains all additional mounts into the container rootfs.
+ // These include the SHM mount.
+ // These must be unmounted before the container's rootfs is unmounted.
Mounts []string `json:"mounts,omitempty"`
- // UserVolumes indicates that the container has user-added volume mounts
- // It is used to trigger OCI hooks that rely on the presence of user
- // volumes
- UserVolumes bool `json:"userVolumes, omitempty"`
// Security Config
+
// Whether the container is privileged
Privileged bool `json:"privileged"`
// SELinux process label for container
@@ -221,11 +219,12 @@ type ContainerConfig struct {
UTSNsCtr string `json:"utsNsCtr,omitempty"`
CgroupNsCtr string `json:"cgroupNsCtr,omitempty"`
- // IDs of dependency containers
- // These containers must be started before this container is started
+ // IDs of dependency containers.
+ // These containers must be started before this container is started.
Dependencies []string
// Network Config
+
// CreateNetNS indicates that libpod should create and configure a new
// network namespace for the container
// This cannot be set if NetNsCtr is also set
@@ -247,7 +246,26 @@ type ContainerConfig struct {
// Will be appended to host's host file
HostAdd []string `json:"hostsAdd,omitempty"`
+ // Image Config
+
+ // UserVolumes contains user-added volume mounts in the container.
+ // These will not be added to the container's spec, as it is assumed
+ // they are already present in the spec given to Libpod. Instead, it is
+ // used when committing containers to generate the VOLUMES field of the
+ // image that is created, and for triggering some OCI hooks which do not
+ // fire unless user-added volume mounts are present.
+ UserVolumes []string `json:"userVolumes,omitempty"`
+ // Entrypoint is the container's entrypoint.
+ // It is not used in spec generation, but will be used when the
+ // container is committed to populate the entrypoint of the new image.
+ Entrypoint []string `json:"entrypoint,omitempty"`
+ // Command is the container's command.
+ // It is not used in spec generation, but will be used when the
+ // container is committed to populate the command of the new image.
+ Command []string `json:"command,omitempty"`
+
// Misc Options
+
// Whether to keep container STDIN open
Stdin bool `json:"stdin,omitempty"`
// Labels is a set of key-value pairs providing additional information