asyncssh icon indicating copy to clipboard operation
asyncssh copied to clipboard

Asyncssh for docker run

Open vimalraghu opened this issue 1 year ago • 2 comments

When we execute docker run command using asyncssh , it is not able to run the command. Whereas docker pull works. What is that should be added for docker runs ? Appreciate quick help here

vimalraghu avatar Apr 25 '24 13:04 vimalraghu

Sorry, there's not enough information here.

What is the exact command you are running, and what error(s) are you getting back?

Are you trying to run AsyncSSH within docker, or just run a "docker" command on a remote system? If you are attempting the latter, does it work when you try the same thing with OpenSSH as your client?

If you are attempting the former, what are the contents of your Dockerfile? Did you include AsyncSSH, Python, and all of the necessary dependencies such as the cryptography package?

ronf avatar Apr 25 '24 13:04 ronf

Consider the approach you're using with the commands you are executing remotely via asyncssh. Is your docker run command launching interactively? (-i) If so, you'd need to be providing a terminal or pipe for it to interact with.

The documentation around create_process clarifies the use of these, and a quick search on SO will give you examples of interactive commands.

Where possible, you will have less headaches when calling processes that do not require or offer any interactivity. You can often force applications into non-interactive mode with an env var or in some cases piping /dev/null to stdin.

Also, please use the discussion section on GitHub for help using the library. This isn't actually an issue with AsyncSSH itself.

Stealthii avatar Apr 25 '24 14:04 Stealthii

Closing due to inactivity. Feel free to reopen this or open a new issue if you need anything else.

ronf avatar Jul 03 '24 15:07 ronf