Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cmd/nerdctl/compose/compose_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func runCommand() *cobra.Command {
cmd.Flags().Bool("no-deps", false, "Don't start dependencies")
// TODO: no-TTY flag
// In docker-compose's documentation, no-TTY is automatically detected
// But, it follows `-i` flag because currently `run` command needs `-it` simultaneously.
cmd.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached")
cmd.Flags().BoolP("tty", "t", false, "Allocate a pseudo-TTY")
cmd.Flags().Bool("rm", false, "Automatically remove the container when it exits")
cmd.Flags().StringP("user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
cmd.Flags().StringArrayP("volume", "v", nil, "Bind mount a volume")
Expand Down Expand Up @@ -119,8 +119,10 @@ func runAction(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
// FIXME : https://github.com/containerd/nerdctl/blob/v0.22.2/cmd/nerdctl/run.go#L100
tty := interactive
tty, err := cmd.Flags().GetBool("tty")
if err != nil {
return err
}
rm, err := cmd.Flags().GetBool("rm")
if err != nil {
return err
Expand Down
5 changes: 1 addition & 4 deletions pkg/composer/up_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ func (c *Composer) upServiceContainer(ctx context.Context, service *serviceparse
return "", fmt.Errorf("error while checking for containers with name %q: %w", container.Name, err)
}

// FIXME
if service.Unparsed.StdinOpen != service.Unparsed.Tty {
return "", fmt.Errorf("currently StdinOpen(-i) and Tty(-t) should be same")
}
// StdinOpen(-i) and Tty(-t) can be specified independently

var runFlagD bool
if !service.Unparsed.StdinOpen && !service.Unparsed.Tty {
Expand Down
Loading