8000 piping into `kamal exec` does not work · Issue #1485 · basecamp/kamal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
piping into kamal exec does not work #1485
Open
@prullmann

Description

@prullmann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0