pyinfra.connectors.dockerssh module

Note: this connector is in beta!

The @dockerssh connector allows you to run commands on Docker containers on a remote machine.

# A Docker base image must be provided
pyinfra @dockerssh/remotehost:alpine:3.8 ...

# pyinfra can run on multiple Docker images in parallel
pyinfra @dockerssh/remotehost:alpine:3.8,@dockerssh/remotehost:ubuntu:bionic ...
class pyinfra.connectors.dockerssh.Meta

Bases: BaseConnectorMeta

handles_execution = True
pyinfra.connectors.dockerssh.connect(state: State, host: Host)
pyinfra.connectors.dockerssh.disconnect(state: State, host: Host)
pyinfra.connectors.dockerssh.get_file(state: State, host: Host, remote_filename, filename_or_io, remote_temp_filename=None, print_output: bool = False, print_input: bool = False, **kwargs)

Download a file from the target Docker container by copying it to a temporary location and then reading that into our final file/IO object.

pyinfra.connectors.dockerssh.make_names_data(host_image_str)
pyinfra.connectors.dockerssh.put_file(state: State, host: Host, filename_or_io, remote_filename, remote_temp_filename=None, print_output: bool = False, print_input: bool = False, **kwargs)

Upload a file/IO object to the target Docker container by copying it to a temporary location and then uploading it into the container using docker cp.

pyinfra.connectors.dockerssh.remote_remove(state: State, host: Host, filename, print_output: bool = False, print_input: bool = False)

Deletes a file on a remote machine over ssh.

pyinfra.connectors.dockerssh.run_shell_command(state: State, host: Host, command, get_pty: bool = False, timeout=None, stdin=None, success_exit_codes=None, print_output: bool = False, print_input: bool = False, return_combined_output=False, **command_kwargs)
pyinfra.connectors.dockerssh.show_warning()