lib/bolt/transport/docker/connection.rb
def execute_local_docker_command(subcommand, command_options = [], redir_stdin = nil)
          env_hash = {}
          # Set the DOCKER_HOST if we are using a non-default service-url
          env_hash['DOCKER_HOST'] = @docker_host unless @docker_host.nil?

          command_options = [] if command_options.nil?
          docker_command = [subcommand].concat(command_options)

          # Always use binary mode for any text data
          capture_options = { binmode: true }
          capture_options[:stdin_data] = redir_stdin unless redir_stdin.nil?
          stdout_str, stderr_str, status = Open3.capture3(env_hash, 'docker', *docker_command, capture_options)
          [stdout_str, stderr_str, status]
        end
# rubocop:disable Layout/LineLength
# Executes a Docker CLI command
#
# @param subcommand [String] The docker subcommand to run e.g. 'inspect' for `docker inspect`
# @param command_options [Array] Additional command options e.g. ['--size'] for `docker inspect --size`
# @param redir_stdin [IO] IO object which will be use to as STDIN in the docker command. Default is nil, which does not perform redirection
# @return [String, String, Process::Status] The output of the command:  STDOUT, STDERR, Process Status
# rubocop:enable Layout/LineLength
disable Layout/LineLength
Executes a Docker CLI command
disable Layout / LineLength Executes a Docker CLI command
def execute_local_docker_command(subcommand, command_options = [], redir_stdin = nil)
          env_hash = {}
          env_hash['DOCKER_HOST'] = @docker_host unless @docker_host.nil?
          command_options = [] if command_options.nil?
          docker_command = [subcommand].concat(command_options)
          capture_options = { binmode: true }
          capture_options[:stdin_data] = redir_stdin unless redir_stdin.nil?
          stdout_str, stderr_str, status = Open3.capture3(env_hash, 'docker', *docker_command, capture_options)
          [stdout_str, stderr_str, status]
        end
def execute_local_docker_command ( subcommand , command_options = [ ] , redir_stdin = nil ) env_hash = { } env_hash [ 'DOCKER_HOST' ] = @docker_host unless @docker_host . nil? command_options = [ ] if command_options . nil? docker_command = [ subcommand ] . concat ( command_options ) capture_options = { binmode : true } capture_options [ :stdin_data ] = redir_stdin unless redir_stdin . nil? stdout_str , stderr_str , status = Open3 . capture3 ( env_hash , 'docker' , * docker_command , capture_options ) [ stdout_str , stderr_str , status ] end
rubocop:disable Layout/LineLength
Executes a Docker CLI command
rubocop : disable Layout / LineLength Executes a Docker CLI command
# Set the DOCKER_HOST if we are using a non-default service-url # Always use binary mode for any text data
The output of the command: STDOUT, STDERR, Process Status rubocop:enable Layout/LineLength
The output of the command : STDOUT STDERR Process Status rubocop : enable Layout / LineLength
String, String, Process::Status
subcommand
The docker subcommand to run e.g. 'inspect' for `docker inspect`
The docker subcommand to run e . g . ' inspect ' for ` docker inspect `
command_options
Additional command options e.g. ['--size'] for `docker inspect --size`
Additional command options e . g . [ ' -- size ' ] for ` docker inspect -- size `
redir_stdin
IO object which will be use to as STDIN in the docker command. Default is nil, which does not perform redirection
IO object which will be use to as STDIN in the docker command . Default is nil which does not perform redirection