@@ -118,7 +118,7 @@ def __del__(self) -> None:
118
118
try :
119
119
with open (cidfile [0 ]) as inp_stream :
120
120
p = subprocess .Popen ( # nosec
121
- ["docker" , "kill" , inp_stream .read ()],
121
+ [args [ 0 ] , "kill" , inp_stream .read ()],
122
122
shell = False , # nosec
123
123
)
124
124
try :
@@ -318,6 +318,8 @@ def new_js_proc(
318
318
nodeimg = "docker.io/node:alpine"
319
319
if container_engine == "singularity" :
320
320
nodeimg = f"docker://{ nodeimg } "
321
+ elif container_engine == "podman" :
322
+ nodeimg = "docker.io/library/node:alpine"
321
323
322
324
if not self .have_node_slim :
323
325
singularity_cache : Optional [str ] = None
@@ -338,6 +340,16 @@ def new_js_proc(
338
340
)
339
341
if singularityimgs :
340
342
nodeimg = singularityimgs [0 ]
343
+ elif container_engine == "udocker" :
344
+ matches = re .search (
345
+ re .escape (nodeimg ),
346
+ subprocess .check_output ( # nosec
347
+ [container_engine , "images" ],
348
+ universal_newlines = True ,
349
+ ),
350
+ )
351
+ if matches :
352
+ dockerimgs = matches [0 ]
341
353
else :
342
354
raise Exception (
343
355
f"Unknown container_engine: { container_engine } ."
@@ -367,7 +379,10 @@ def new_js_proc(
367
379
)
368
380
self .have_node_slim = True
369
381
nodejs_commands = [container_engine ]
370
- if container_engine != "singularity" :
382
+ if (
383
+ container_engine != "singularity"
384
+ and "udocker" not in container_engine
385
+ ):
371
386
nodejs_commands .extend (
372
387
[
373
388
"run" ,
@@ -379,7 +394,7 @@ def new_js_proc(
379
394
"--rm" ,
380
395
]
381
396
)
382
- else :
397
+ elif "singularity" in container_engine :
383
398
nodejs_commands .extend (
384
399
[
385
400
"exec" ,
@@ -389,6 +404,15 @@ def new_js_proc(
389
404
"--userns" if singularity_supports_userns () else "--pid" ,
390
405
]
391
406
)
407
+ elif "udocker" in container_engine :
408
+ nodejs_commands .extend (
409
+ [
410
+ "run" ,
411
+ "--device=/dev/stdin" ,
412
+ "--device=/dev/stdout" ,
413
+ "--device=/dev/stderr" ,
414
+ ]
415
+ )
392
416
nodejs_commands .extend (
393
417
[
394
418
nodeimg ,
0 commit comments