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: pyinfra.api.connectors.BaseConnectorMeta

handles_execution = True
pyinfra.connectors.dockerssh.connect(state, host)
pyinfra.connectors.dockerssh.disconnect(state, host)
pyinfra.connectors.dockerssh.get_file(state, host, remote_filename, filename_or_io, remote_temp_filename=None, print_output=False, print_input=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, host, filename_or_io, remote_filename, remote_temp_filename=None, print_output=False, print_input=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, host, filename, print_output=False, print_input=False)

Deletes a file on a remote machine over ssh.

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