Skip to content

Add docker compose attach? (to support STDIN) #11153

Description

@g0t4

Description

Similar to docker container attach, would docker compose attach be a reasonable thing to add? I'd like to attach to STDIN/OUT simultaneously and send input to my service container(s) and see their output. AFAICT, docker compose up only attaches STDOUT.

For example, I have a compose project w/ a single service that runs dotnet watch. If changes can't be hot reloaded then I can send Ctrl+R to the dotnet watch process to trigger a rebuild.

I can use docker container attach to send Ctrl+R currently as a workaround with stdin_open: true and tty: true in my service definition.

Ideally this would also be combined with docker compose up to bring up and then attach STDIN right away.

  • perhaps docker compose up -i/--interactive?
  • and either a single service limitation
  • or if multi service then broadcast to all STDIN
  • I would also understand if this is too confusing to merge with up in which case attach alone would be great

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions