8302888: containers/docker/TestJcmd.java fails when run as root under podman

Reviewed-by: dholmes
This commit is contained in:
Severin Gehwolf 2023-02-22 08:35:10 +00:00
parent b6ecca1268
commit 7f35389533

@ -169,7 +169,7 @@ public class TestJcmd {
.addDockerOpts("--name", CONTAINER_NAME)
.addClassOptions("" + TIME_TO_RUN_CONTAINER_PROCESS);
if (IS_PODMAN) {
if (IS_PODMAN && !ROOT_UID.equals(getId("-u"))) {
// map the current userid to the one in the target namespace
opts.addDockerOpts("--userns=keep-id");
}