Class DockerCommand
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker.DockerCommand
- Direct Known Subclasses:
DockerExecCommand,DockerImagesCommand,DockerInspectCommand,DockerKillCommand,DockerLoadCommand,DockerPullCommand,DockerRmCommand,DockerRunCommand,DockerStartCommand,DockerStopCommand,DockerVolumeCommand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddCommandArguments(String key, String value) Add command commandWithArguments - this method is only meant for use by sub-classes.final StringReturns the docker sub-command string being used e.g 'run'.preparePrivilegedOperation(DockerCommand dockerCommand, String containerName, Map<String, String> env, Context nmContext) Prepare the privileged operation object that will be used to invoke the container-executor.voidsetClientConfigDir(String clientConfigDir) Add the client configuration directory to the docker command.toString()
-
Constructor Details
-
DockerCommand
-
-
Method Details
-
getCommandOption
Returns the docker sub-command string being used e.g 'run'. -
addCommandArguments
Add command commandWithArguments - this method is only meant for use by sub-classes.- Parameters:
key- name of the key to be addedvalue- value of the key
-
getDockerCommandWithArguments
-
toString
-
setClientConfigDir
Add the client configuration directory to the docker command. The client configuration option proceeds any of the docker subcommands (such as run, load, pull, etc). Ordering will be handled by container-executor. Docker expects the value to be a directory containing the file config.json. This file is typically generated via docker login.- Parameters:
clientConfigDir- - directory containing the docker client config.
-
preparePrivilegedOperation
public PrivilegedOperation preparePrivilegedOperation(DockerCommand dockerCommand, String containerName, Map<String, String> env, Context nmContext) throws ContainerExecutionExceptionPrepare the privileged operation object that will be used to invoke the container-executor.- Parameters:
dockerCommand- Specific command to be run by docker.containerName-env-nmContext-- Returns:
- Returns the PrivilegedOperation object to be used.
- Throws:
ContainerExecutionException
-