Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run: add support --no-build, --pull flags #12032

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

legobeat
Copy link

@legobeat legobeat commented Jul 30, 2024

Allows setting build- and pull policies for docker-compose run like for docker run and docker-compose up.

@legobeat legobeat force-pushed the run-configurable-pull-policy branch 2 times, most recently from 1f0f5aa to abfbd7c Compare July 30, 2024 10:11
@legobeat legobeat marked this pull request as ready for review July 30, 2024 10:14
@legobeat legobeat force-pushed the run-configurable-pull-policy branch 2 times, most recently from 95e5968 to a675a1e Compare August 2, 2024 00:21
cmd/compose/run.go Outdated Show resolved Hide resolved
@legobeat legobeat force-pushed the run-configurable-pull-policy branch from a675a1e to 837e020 Compare August 5, 2024 23:54
@legobeat legobeat requested a review from ndeloof August 6, 2024 03:30
@@ -81,6 +82,12 @@ func (options runOptions) apply(project *types.Project) (*types.Project, error)
}

target.Tty = !options.noTty
if options.noBuild {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why configure build is no-build was requested?

Copy link
Author

@legobeat legobeat Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that:

  • If --no-build is passed, we do not want to build, so clear the existing build configuration from the service.
  • Build.Pull and Build.Tags may affect behavior outside of the actual build, so we selectively preserve those.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ndeloof Looping back here! Does this makes sense or do you think it should behave differently? Should I add some clarification in comments or docs...?

Allows setting build- and pull policies for `compose run` like for `docker run` and `compose up`.

Signed-off-by: legobt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants