#1604·nerdctl

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

Author: djdongjinCreated Dec 4, 2022Updated Aug 20, 2026
Labelsarea/composekind/feature

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 https://github.com/containerd/nerdctl/commit/18ea81f8f7cb6949b4748349b2782aad19e4d484. 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