File tree Expand file tree Collapse file tree 1 file changed +28
-12
lines changed Expand file tree Collapse file tree 1 file changed +28
-12
lines changed Original file line number Diff line number Diff line change @@ -445,18 +445,34 @@ func startContainer(ctx context.Context) (c *Container, err error) {
445
445
446
446
name := "play_run_" + randHex (8 )
447
447
setContainerWanted (name , true )
448
- cmd := exec .Command ("docker" , "run" ,
449
- "--name=" + name ,
450
- "--rm" ,
451
- "--tmpfs=/tmpfs:exec" ,
452
- "-i" , // read stdin
453
-
454
- "--runtime=runsc" ,
455
- "--network=none" ,
456
- "--memory=" + fmt .Sprint (memoryLimitBytes ),
457
-
458
- * container ,
459
- "--mode=contained" )
448
+ var cmd * exec.Cmd
449
+ if _ , err := os .Stat ("/var/lib/docker/runsc" ); err == nil {
450
+ cmd = exec .Command ("docker" , "run" ,
451
+ "--name=" + name ,
452
+ "--rm" ,
453
+ "--tmpfs=/tmpfs:exec" ,
454
+ "-i" , // read stdin
455
+
456
+ "--runtime=runsc" ,
457
+ "--network=none" ,
458
+ "--memory=" + fmt .Sprint (memoryLimitBytes ),
459
+
460
+ * container ,
461
+ "--mode=contained" )
462
+ } else {
463
+ cmd = exec .Command ("docker" , "run" ,
464
+ "--name=" + name ,
465
+ "--rm" ,
466
+ "--tmpfs=/tmpfs:exec" ,
467
+ "-i" , // read stdin
468
+
469
+ "--network=none" ,
470
+ "--memory=" + fmt .Sprint (memoryLimitBytes ),
471
+
472
+ * container ,
473
+ "--mode=contained" )
474
+ }
475
+
460
476
stdin , err := cmd .StdinPipe ()
461
477
if err != nil {
462
478
return nil , err
You can’t perform that action at this time.
0 commit comments