mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix default tmpfs size to prevent breakage
Signed-off-by: Jess Frazelle <me@jessfraz.com>
This commit is contained in:
parent
6717b35503
commit
982c5f199f
2 changed files with 5 additions and 3 deletions
|
@ -480,7 +480,7 @@ func setMounts(daemon *Daemon, s *specs.Spec, c *container.Container, mounts []c
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Source == "tmpfs" {
|
if m.Source == "tmpfs" {
|
||||||
options := []string{"noexec", "nosuid", "nodev", volume.DefaultPropagationMode, "size=65536k"}
|
options := []string{"noexec", "nosuid", "nodev", volume.DefaultPropagationMode}
|
||||||
if m.Data != "" {
|
if m.Data != "" {
|
||||||
options = append(options, strings.Split(m.Data, ",")...)
|
options = append(options, strings.Split(m.Data, ",")...)
|
||||||
}
|
}
|
||||||
|
|
|
@ -833,17 +833,19 @@ func (s *DockerSuite) TestRunTmpfsMounts(c *check.C) {
|
||||||
func (s *DockerSuite) TestRunTmpfsMountsWithOptions(c *check.C) {
|
func (s *DockerSuite) TestRunTmpfsMountsWithOptions(c *check.C) {
|
||||||
testRequires(c, DaemonIsLinux)
|
testRequires(c, DaemonIsLinux)
|
||||||
|
|
||||||
expectedOptions := []string{"rw", "nosuid", "nodev", "noexec", "relatime", "size=65536k"}
|
expectedOptions := []string{"rw", "nosuid", "nodev", "noexec", "relatime"}
|
||||||
out, _ := dockerCmd(c, "run", "--tmpfs", "/tmp", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
|
out, _ := dockerCmd(c, "run", "--tmpfs", "/tmp", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
|
||||||
for _, option := range expectedOptions {
|
for _, option := range expectedOptions {
|
||||||
c.Assert(out, checker.Contains, option)
|
c.Assert(out, checker.Contains, option)
|
||||||
}
|
}
|
||||||
|
c.Assert(out, checker.Not(checker.Contains), "size=")
|
||||||
|
|
||||||
expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime", "size=65536k"}
|
expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime"}
|
||||||
out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
|
out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
|
||||||
for _, option := range expectedOptions {
|
for _, option := range expectedOptions {
|
||||||
c.Assert(out, checker.Contains, option)
|
c.Assert(out, checker.Contains, option)
|
||||||
}
|
}
|
||||||
|
c.Assert(out, checker.Not(checker.Contains), "size=")
|
||||||
|
|
||||||
expectedOptions = []string{"rw", "nosuid", "nodev", "relatime", "size=8192k"}
|
expectedOptions = []string{"rw", "nosuid", "nodev", "relatime", "size=8192k"}
|
||||||
out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,exec,size=8192k", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
|
out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,exec,size=8192k", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
|
||||||
|
|
Loading…
Add table
Reference in a new issue