cmd/create: Simplify code

Fallout from 8e80dd5db1

https://github.com/containers/toolbox/pull/1256
This commit is contained in:
Debarshi Ray 2023-03-07 17:20:50 +01:00
parent aeae18920b
commit fb15655ace

View file

@ -254,8 +254,6 @@ func createContainer(container, image, release, authFile string, showCommandToEn
devPtsMount = []string{"--mount", "type=devpts,destination=/dev/pts"} devPtsMount = []string{"--mount", "type=devpts,destination=/dev/pts"}
} }
ulimitHost := []string{"--ulimit", "host"}
var usernsArg string var usernsArg string
if currentUser.Uid == "0" { if currentUser.Uid == "0" {
usernsArg = "host" usernsArg = "host"
@ -417,11 +415,7 @@ func createContainer(container, image, release, authFile string, showCommandToEn
"--pid", "host", "--pid", "host",
"--privileged", "--privileged",
"--security-opt", "label=disable", "--security-opt", "label=disable",
}...) "--ulimit", "host",
createArgs = append(createArgs, ulimitHost...)
createArgs = append(createArgs, []string{
"--userns", usernsArg, "--userns", usernsArg,
"--user", "root:root", "--user", "root:root",
"--volume", "/:/run/host:rslave", "--volume", "/:/run/host:rslave",