Skip to content

Fix flag -t needs -i to be specified together restriction in compose run #1604

Open

Description

@djdongjin

What is the problem you're trying to solve

Previously -i and -t cannot be specified together in nerdctl exec/run, which was fixed in 18ea81f. We should be able to remove the restriction in nerdctl compose run as well.

This can be a good first issue.

Describe the solution you'd like

nerdctl compose run can use -i, -t independently. Some places to look into:

https://github.com/containerd/nerdctl/blob/main/cmd/nerdctl/run.go#L101 (update -t usage document)

https://github.com/containerd/nerdctl/blob/main/cmd/nerdctl/compose_run.go#L119 (update -t usage and use the cli value)

https://github.com/containerd/nerdctl/blob/main/pkg/composer/run.go (make sure -i, -t are used correctly)

https://github.com/containerd/nerdctl/blob/main/pkg/composer/up_service.go#L160 (remove the restriction)

Also add integration test for compose run similar to the tests in the above commit.

Additional context

No response

Activity

  1. djdongjin commented on Dec 15, 2022

    @djdongjin
    MemberAuthor

    #1642 may solve part of the issue (non-compose part)

  2. wryyyds7 commented on Aug 20, 2026

    @wryyyds7

    I've opened a PR to fix this: #5149

    The fix adds a standalone -t/--tty flag to compose run and removes the restriction that StdinOpen and Tty must be equal. I've verified with 30 test cases comparing original and modified behavior — all -t related scenarios now work correctly without regressions.

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