aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/container_linux.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-01 21:23:52 +0900
committerOphestra <cat@gensokyo.uk>2025-08-01 21:23:52 +0900
commitaf0899de9640b4336050b07b739818fdc3add08b (patch)
treedfc84b596e4d256b929ca91978c40db5eca5bdc4 /internal/app/container_linux.go
parent547a2adaa488556f0504e186c5c1dfb0e679c935 (diff)
hst/container: mount tmpfs via magic src string
There's often good reason to mount tmpfs in the container. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/container_linux.go')
-rw-r--r--internal/app/container_linux.go14
1 files changed, 14 insertions, 0 deletions
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)
}