'Run a command on the docker host'

def exec_command(self, cmd, in_data=None, sudoable=False):

    super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
    local_cmd = self._build_exec_cmd([self._play_context.executable, '-c', cmd])
    display.vvv(('EXEC    %s' % (local_cmd,)), host=self._play_context.remote_addr)
    local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
    p = subprocess.Popen(local_cmd, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (stdout, stderr) = p.communicate(in_data)
    return (p.returncode, stdout, stderr)
