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

@Private @Unstable public abstract class DockerCommand extends Object
  • Constructor Details

    • DockerCommand

      protected DockerCommand(String command)
  • Method Details

    • getCommandOption

      public final String getCommandOption()
      Returns the docker sub-command string being used e.g 'run'.
    • addCommandArguments

      protected final void addCommandArguments(String key, String value)
      Add command commandWithArguments - this method is only meant for use by sub-classes.
      Parameters:
      key - name of the key to be added
      value - value of the key
    • getDockerCommandWithArguments

      public Map<String,List<String>> getDockerCommandWithArguments()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setClientConfigDir

      public void setClientConfigDir(String clientConfigDir)
      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 ContainerExecutionException
      Prepare 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