summaryrefslogtreecommitdiff
path: root/cmd/podman/create.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-01-10 15:58:18 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-11 12:39:06 +0000
commitdd0d35deb098b63f8c5be7ef9d8d63c16760221b (patch)
tree695d44a49d636e45e4121c9aecfb3d8c0e1cca06 /cmd/podman/create.go
parente6be800ec633342aef656e0a2ed0bdc4519796d9 (diff)
downloadpodman-dd0d35deb098b63f8c5be7ef9d8d63c16760221b.tar.gz
podman-dd0d35deb098b63f8c5be7ef9d8d63c16760221b.tar.bz2
podman-dd0d35deb098b63f8c5be7ef9d8d63c16760221b.zip
Add support for shm-size.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #206 Approved by: TomSweeneyRedHat
Diffstat (limited to 'cmd/podman/create.go')
-rw-r--r--cmd/podman/create.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index bb9a31467..ce06ac51b 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -62,7 +62,7 @@ type createResourceConfig struct {
MemorySwappiness int // memory-swappiness
OomScoreAdj int //oom-score-adj
PidsLimit int64 // pids-limit
- ShmSize string
+ ShmSize int64
Ulimit []string //ulimit
}
@@ -179,6 +179,7 @@ func createCmd(c *cli.Context) error {
options = append(options, libpod.WithLabels(createConfig.Labels))
options = append(options, libpod.WithUser(createConfig.User))
options = append(options, libpod.WithShmDir(createConfig.ShmDir))
+ options = append(options, libpod.WithShmSize(createConfig.Resources.ShmSize))
ctr, err := runtime.NewContainer(runtimeSpec, options...)
if err != nil {
return err
@@ -524,6 +525,12 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
return nil, err
}
+ // SHM SIze
+ shmSize, err := units.FromHumanSize(c.String("shm-size"))
+ if err != nil {
+ return nil, errors.Wrapf(err, "unable to translate --shm-size")
+ }
+
config := &createConfig{
Runtime: runtime,
CapAdd: c.StringSlice("cap-add"),
@@ -580,7 +587,7 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
DeviceWriteBps: c.StringSlice("device-write-bps"),
DeviceWriteIOps: c.StringSlice("device-write-iops"),
DisableOomKiller: c.Bool("oom-kill-disable"),
- ShmSize: c.String("shm-size"),
+ ShmSize: shmSize,
Memory: memoryLimit,
MemoryReservation: memoryReservation,
MemorySwap: memorySwap,