Skip to content

Commit

Permalink
Issue-11374: Modified compose up command to respect COMPOSE_REMOVE_OR…
Browse files Browse the repository at this point in the history
…PHANS environment variable

Signed-off-by: Gautham Hullikunte <46633282+batcity@users.noreply.github.com>
Signed-off-by: Gautham Hullikunte <gautham@Gauthams-MacBook-Pro.local>
  • Loading branch information
Gautham Hullikunte authored and ndeloof committed Feb 17, 2024
1 parent f1431b2 commit 6c17554
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/compose/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"os"
"strings"
"time"

Expand Down Expand Up @@ -104,7 +105,8 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service) *c
flags.BoolVar(&create.Build, "build", false, "Build images before starting containers")
flags.BoolVar(&create.noBuild, "no-build", false, "Don't build an image, even if it's policy")
flags.StringVar(&create.Pull, "pull", "policy", `Pull image before running ("always"|"missing"|"never")`)
flags.BoolVar(&create.removeOrphans, "remove-orphans", false, "Remove containers for services not defined in the Compose file")
removeOrphans := utils.StringToBool(os.Getenv(ComposeRemoveOrphans))
flags.BoolVar(&create.removeOrphans, "remove-orphans", removeOrphans, "Remove containers for services not defined in the Compose file")
flags.StringArrayVar(&create.scale, "scale", []string{}, "Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.")
flags.BoolVar(&up.noColor, "no-color", false, "Produce monochrome output")
flags.BoolVar(&up.noPrefix, "no-log-prefix", false, "Don't print prefix in logs")
Expand Down

0 comments on commit 6c17554

Please sign in to comment.