2021-10-21 00:51:32 +00:00
|
|
|
package docker
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
"ledo/app/modules/compose"
|
|
|
|
"ledo/app/modules/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
var CmdComposeRun = cli.Command{
|
|
|
|
Name: "run",
|
2021-10-21 16:01:31 +00:00
|
|
|
Aliases: []string{"r"},
|
2021-10-21 00:51:32 +00:00
|
|
|
Usage: "run cmd in main container",
|
|
|
|
Description: `Run command in main container`,
|
2021-10-21 16:01:31 +00:00
|
|
|
ArgsUsage: "[<cmd>]",
|
2021-10-21 00:51:32 +00:00
|
|
|
Action: RunComposeRun,
|
|
|
|
}
|
|
|
|
|
|
|
|
func RunComposeRun(cmd *cli.Context) error {
|
|
|
|
ctx := context.InitCommand(cmd)
|
2021-10-21 16:01:31 +00:00
|
|
|
if cmd.Args().Len() >= 1 {
|
|
|
|
compose.ExecComposerRun(ctx, cmd.Args())
|
|
|
|
return nil
|
|
|
|
}
|
2021-10-21 00:51:32 +00:00
|
|
|
return nil
|
|
|
|
}
|