diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java index a311207bae5..33fdbd302b5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java @@ -924,17 +924,17 @@ public class DockerLinuxContainerRuntime implements LinuxContainerRuntime { @Override public void relaunchContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException { - Container container = ctx.getContainer(); - String containerIdStr = container.getContainerId().toString(); + ContainerId containerId = ctx.getContainer().getContainerId(); + String containerIdStr = containerId.toString(); // Check to see if the container already exists for relaunch DockerCommandExecutor.DockerContainerStatus containerStatus = DockerCommandExecutor.getContainerStatus(containerIdStr, conf, - privilegedOperationExecutor); + privilegedOperationExecutor, nmContext); if (containerStatus != null && DockerCommandExecutor.isStartable(containerStatus)) { DockerStartCommand startCommand = new DockerStartCommand(containerIdStr); String commandFile = dockerClient.writeCommandToTempFile(startCommand, - containerIdStr); + containerId, nmContext); PrivilegedOperation launchOp = buildLaunchOp(ctx, commandFile, startCommand);