From af0899de9640b4336050b07b739818fdc3add08b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 1 Aug 2025 21:23:52 +0900 Subject: hst/container: mount tmpfs via magic src string There's often good reason to mount tmpfs in the container. Signed-off-by: Ophestra --- internal/app/container_linux.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal/app/container_linux.go') diff --git a/internal/app/container_linux.go b/internal/app/container_linux.go index cd9448a8..09909d83 100644 --- a/internal/app/container_linux.go +++ b/internal/app/container_linux.go @@ -156,6 +156,20 @@ func newContainer(s *hst.ContainerConfig, os sys.State, prefix string, uid, gid continue } + // special filesystems + switch c.Src { + case hst.SourceTmpfs: + if !path.IsAbs(c.Dst) { + return nil, nil, fmt.Errorf("tmpfs dst %q is not absolute", c.Dst) + } + if c.Write { + params.Tmpfs(c.Dst, hst.TmpfsSize, hst.TmpfsPerm) + } else { + params.Readonly(c.Dst, hst.TmpfsPerm) + } + continue + } + if !path.IsAbs(c.Src) { return nil, nil, fmt.Errorf("src path %q is not absolute", c.Src) } -- cgit v1.3.1