aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'container/container.go')
-rw-r--r--container/container.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/container/container.go b/container/container.go
index 85e6596f..8af77315 100644
--- a/container/container.go
+++ b/container/container.go
@@ -100,6 +100,11 @@ type (
Gid int
// Hostname value in UTS namespace.
Hostname string
+ // Register binfmt_misc entries.
+ Binfmt []BinfmtEntry
+ // Alternative pathname to attach binfmt_misc filesystem. The zero value
+ // requires [FstypeProc] to be made available at [fhs.Proc].
+ BinfmtPath *check.Absolute
// Sequential container setup ops.
*Ops
@@ -219,6 +224,9 @@ func (p *Container) Start() error {
if p.cmd.Process != nil {
return errors.New("container: already started")
}
+ if !p.InitAsRoot && len(p.Binfmt) > 0 {
+ return errors.New("container: init as root required, but not enabled")
+ }
if err := ensureCloseOnExec(); err != nil {
return err