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

clean service command if entrypoint is overrided in run command #9836

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

glours
Copy link
Contributor

@glours glours commented Sep 13, 2022

What I did
re-init default service command when the --entrypoint is used with docker compose run

Related issue
fixes #9622

(not mandatory) A picture of a cute animal, if possible in relation with what you did
image

Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

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

What do you think about doing this in applyRunOptions instead?

I'm unclear why both runOptions::apply and applyRunOptions exist in the first place...but since the "other" func is already messing with cmd/entrypoint, it seems the safer place to co-locate this code with

compose/pkg/compose/run.go

Lines 104 to 106 in 1ed37ef

if len(opts.Command) > 0 {
service.Command = opts.Command
}

compose/pkg/compose/run.go

Lines 113 to 115 in 1ed37ef

if opts.Entrypoint != nil {
service.Entrypoint = opts.Entrypoint
}

@glours glours force-pushed the update-entrypoint-clean-command branch from a4a0872 to e192e22 Compare September 26, 2022 15:45
@glours glours requested review from milas and a team September 26, 2022 15:52
@milas milas merged commit 2792258 into docker:v2 Sep 26, 2022
@glours glours deleted the update-entrypoint-clean-command branch January 11, 2023 14:22
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.

docker compose run --entrypoint=EXECUTABLE SERVICENAME fails to clear CMD
2 participants