use docker/cli RunExec and RunStart to handle all the interactive/tty/* terminal logic

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2022-03-09 17:52:30 +01:00 committed by Nicolas De loof
parent d999c230a5
commit 1d4b4e3c8e
8 changed files with 49 additions and 310 deletions

View file

@ -62,6 +62,9 @@ func (opts runOptions) apply(project *types.Project) error {
if err != nil {
return err
}
target.Tty = !opts.noTty
target.StdinOpen = opts.interactive
if !opts.servicePorts {
target.Ports = []types.ServicePortConfig{}
}
@ -207,6 +210,7 @@ func runRun(ctx context.Context, backend api.Service, project *types.Project, op
Detach: opts.Detach,
AutoRemove: opts.Remove,
Tty: !opts.noTty,
Interactive: opts.interactive,
WorkingDir: opts.workdir,
User: opts.user,
Environment: opts.environment,

View file

@ -68,7 +68,7 @@ func pluginMain() {
}
func main() {
if commands.RunningAsStandalone() {
if plugin.RunningStandalone() {
os.Args = append([]string{"docker"}, compatibility.Convert(os.Args[1:])...)
}
pluginMain()