YARN-5394. Remove bind-mount /etc/passwd for Docker containers. Contributed by Zhankun Tang.
This commit is contained in:
parent
82c9e06101
commit
522ddbde79
@ -343,8 +343,7 @@ public void launchContainer(ContainerRuntimeContext ctx)
|
|||||||
.detachOnRun()
|
.detachOnRun()
|
||||||
.setContainerWorkDir(containerWorkDir.toString())
|
.setContainerWorkDir(containerWorkDir.toString())
|
||||||
.setNetworkType(network)
|
.setNetworkType(network)
|
||||||
.setCapabilities(capabilities)
|
.setCapabilities(capabilities);
|
||||||
.addMountLocation("/etc/passwd", "/etc/password:ro");
|
|
||||||
List<String> allDirs = new ArrayList<>(containerLocalDirs);
|
List<String> allDirs = new ArrayList<>(containerLocalDirs);
|
||||||
|
|
||||||
allDirs.addAll(filecacheDirs);
|
allDirs.addAll(filecacheDirs);
|
||||||
|
@ -276,7 +276,6 @@ public void testDockerContainerLaunch()
|
|||||||
.append("--workdir=%3$s ")
|
.append("--workdir=%3$s ")
|
||||||
.append("--net=host ")
|
.append("--net=host ")
|
||||||
.append(getExpectedTestCapabilitiesArgumentString())
|
.append(getExpectedTestCapabilitiesArgumentString())
|
||||||
.append("-v /etc/passwd:/etc/password:ro ")
|
|
||||||
.append("-v %4$s:%4$s ")
|
.append("-v %4$s:%4$s ")
|
||||||
.append("-v %5$s:%5$s ")
|
.append("-v %5$s:%5$s ")
|
||||||
.append("-v %6$s:%6$s ")
|
.append("-v %6$s:%6$s ")
|
||||||
@ -382,7 +381,6 @@ public void testContainerLaunchWithNetworkingDefaults()
|
|||||||
.append("--workdir=%3$s ")
|
.append("--workdir=%3$s ")
|
||||||
.append("--net=" + allowedNetwork + " ")
|
.append("--net=" + allowedNetwork + " ")
|
||||||
.append(getExpectedTestCapabilitiesArgumentString())
|
.append(getExpectedTestCapabilitiesArgumentString())
|
||||||
.append("-v /etc/passwd:/etc/password:ro ")
|
|
||||||
.append("-v %4$s:%4$s ").append("-v %5$s:%5$s ")
|
.append("-v %4$s:%4$s ").append("-v %5$s:%5$s ")
|
||||||
.append("-v %6$s:%6$s ").append("-v %7$s:%7$s ")
|
.append("-v %6$s:%6$s ").append("-v %7$s:%7$s ")
|
||||||
.append("-v %8$s:%8$s ").append("%9$s ")
|
.append("-v %8$s:%8$s ").append("%9$s ")
|
||||||
@ -437,7 +435,6 @@ public void testContainerLaunchWithCustomNetworks()
|
|||||||
.append("--workdir=%3$s ")
|
.append("--workdir=%3$s ")
|
||||||
.append("--net=" + customNetwork1 + " ")
|
.append("--net=" + customNetwork1 + " ")
|
||||||
.append(getExpectedTestCapabilitiesArgumentString())
|
.append(getExpectedTestCapabilitiesArgumentString())
|
||||||
.append("-v /etc/passwd:/etc/password:ro ")
|
|
||||||
.append("-v %4$s:%4$s ").append("-v %5$s:%5$s ")
|
.append("-v %4$s:%4$s ").append("-v %5$s:%5$s ")
|
||||||
.append("-v %6$s:%6$s ").append("-v %7$s:%7$s ")
|
.append("-v %6$s:%6$s ").append("-v %7$s:%7$s ")
|
||||||
.append("-v %8$s:%8$s ").append("%9$s ")
|
.append("-v %8$s:%8$s ").append("%9$s ")
|
||||||
@ -474,7 +471,6 @@ public void testContainerLaunchWithCustomNetworks()
|
|||||||
.append("--workdir=%3$s ")
|
.append("--workdir=%3$s ")
|
||||||
.append("--net=" + customNetwork2 + " ")
|
.append("--net=" + customNetwork2 + " ")
|
||||||
.append(getExpectedTestCapabilitiesArgumentString())
|
.append(getExpectedTestCapabilitiesArgumentString())
|
||||||
.append("-v /etc/passwd:/etc/password:ro ")
|
|
||||||
.append("-v %4$s:%4$s ").append("-v %5$s:%5$s ")
|
.append("-v %4$s:%4$s ").append("-v %5$s:%5$s ")
|
||||||
.append("-v %6$s:%6$s ").append("-v %7$s:%7$s ")
|
.append("-v %6$s:%6$s ").append("-v %7$s:%7$s ")
|
||||||
.append("-v %8$s:%8$s ").append("%9$s ")
|
.append("-v %8$s:%8$s ").append("%9$s ")
|
||||||
|
Loading…
Reference in New Issue
Block a user