Description
When trying to pipe data into commands executed in containers using kamal exec
, no data is recieved.
Use Case:
I am trying to restore a database backup via the following command from my dev machine:
kamal accessory exec -i --reuse mysql 'mysql example_db"' < example_db_backup.sql
(ignoring password handling for this example)
Kamal translates this to:
ssh -t example_host docker exec -it example_project-mysql 'mysql example_db' < example_db_backup.sql
However, to make piping through docker work, -i
has to be set, but not -t
.
Proposed Solution:
I suggest that besides the --interactive
/-i
flag, a --tty
/-t
flag is added to control both independently.
Alternative Solution:
Kamal could also check if STDIN is attached to a file/pipe when interactive is enabled and set -i
instead of -ti
in this case.
If one of those solutions sound acceptable, I am happy to write a PR.