File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -174,16 +174,18 @@ def start(
174174 security_opt = None
175175 command = shell
176176 tmpfs = {}
177+ cgroupns = None
177178 if systemd :
178179 # If we are running in a systemd context, the following 3 settings are necessary to
179180 # allow services to run.
180- volumes [
181- "/sys/fs/cgroup"
182- ] = f"/sys/fs/cgroup:{ 'rw' if systemd_v248 else 'ro' } "
183- security_opt = ["seccomp=unconfined" ]
184- command = "/usr/sbin/init"
185181 if systemd_v248 :
182+ volumes ["/sys/fs/cgroup/buildrunner.scope" ] = "/sys/fs/cgroup:rw"
186183 tmpfs ["/run" ] = ""
184+ cgroupns = "host"
185+ else :
186+ volumes ["/sys/fs/cgroup" ] = "/sys/fs/cgroup:ro"
187+ security_opt = ["seccomp=unconfined" ]
188+ command = "/usr/sbin/init"
187189
188190 if volumes :
189191 for key , value in volumes .items ():
@@ -231,6 +233,7 @@ def start(
231233 cap_add = cap_add ,
232234 privileged = privileged ,
233235 tmpfs = tmpfs ,
236+ cgroupns = cgroupns ,
234237 ),
235238 }
236239 if entrypoint :
You can’t perform that action at this time.
0 commit comments