diff --git a/src/spec-node/singleContainer.ts b/src/spec-node/singleContainer.ts index 9b0783443..5952e3ea4 100644 --- a/src/spec-node/singleContainer.ts +++ b/src/spec-node/singleContainer.ts @@ -409,6 +409,7 @@ while sleep 1 & wait $!; do :; done`, '-']; // `wait $!` allows for the `trap` t ...getLabels(labels), ...containerEnv, ...containerUserArgs, + ...getPodmanArgs(params), ...(config.runArgs || []), ...(await extraRunArgs(common, params, config) || []), ...featureArgs, @@ -433,6 +434,13 @@ while sleep 1 & wait $!; do :; done`, '-']; // `wait $!` allows for the `trap` t common.output.stop(text, start); } +function getPodmanArgs(params: DockerResolverParameters): string[] { + if (params.isPodman && params.common.cliHost.platform === 'linux') { + return ['--security-opt', 'label=disable', '--userns=keep-id']; + } + return []; +} + function getLabels(labels: string[]): string[] { let result: string[] = []; labels.forEach(each => result.push('-l', each));