Skip to content

chore: normalize docker compose commands #778

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

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

Conversation

7-zete-7
Copy link
Contributor

@7-zete-7 7-zete-7 commented Apr 9, 2025

Part of #776

This PR brings the following commands to uniform formats:

  • docker compose ... build --pull --no-cache

    • The options are set in this order (this order was more common in this template).
  • docker compose ... up --wait

    • Specifying the -d option is optional (the --wait option implies the -d option).
  • docker compose ... down --remove-orphans

    Already in a unified format.

@7-zete-7
Copy link
Contributor Author

7-zete-7 commented Apr 9, 2025

Command formats are based on the most popular variants in this template. Suggestions for better format options are welcome 👍

@7-zete-7 7-zete-7 changed the title docs: normalize docker compose commands chore: normalize docker compose commands Apr 9, 2025
Copy link

@lermontex lermontex left a comment

Choose a reason for hiding this comment

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

It looks like this is another PR of yours that doesn't solve any issue.

The --wait flag must be used with detached mode.

Wait for services to be running|healthy. Implies detached mode.

https://docs.docker.com/reference/cli/docker/compose/up/

Related Issue: #436

This PR brings the following commands to uniform formats

The commands are already applied in a uniform style (the long flag is applied in the absence of the short one)

Also, it seems like you have no idea what you're doing when you remove/add flags (pull, always, etc.) in the docs.

@7-zete-7
Copy link
Contributor Author

7-zete-7 commented Apr 9, 2025

Thanks for the info, @lermontex!

I'm glad to get your critique!

It looks like this is another PR of yours that doesn't solve any issue.

The --wait flag must be used with detached mode.

Wait for services to be running|healthy. Implies detached mode.

https://docs.docker.com/reference/cli/docker/compose/up/

Related Issue: #436

I haven't encountered this problem before and I'm curious to know what could be causing the problem. I didn't pay attention to this issue, my mistake. I'll probably change the unified format for this command.

I couldn't find an issue in the repository https://github.com/docker/compose about this problem. Maybe you have a link to something similar?

A very strange error. By the Docker Compose source code, the -d option is indeed explicitly enabled when the --wait option is present (see https://github.com/docker/compose/blame/01e83defc2e7c59c765be89509ce0f736dfcfc43/cmd/compose/up.go#L195-L200).


This PR brings the following commands to uniform formats

The commands are already applied in a uniform style (the long flag is applied in the absence of the short one)

I can't agree with your statement. If you look at least in different parts of the documentation, you can see the presence and absence of the --wait option for the docker compose up command. Although they are needed in all cases.


Also, it seems like you have no idea what you're doing when you remove/add flags (pull, always, etc.) in the docs.

I have information from the documentation (see https://docs.docker.com/reference/cli/docker/compose/up/#options, https://docs.docker.com/reference/cli/docker/compose/build/#options), as well as personal experience in working with these options.

In my opinion, these options are used correctly in these changes.

If you have information on how this will change the behavior of the changed commands in a negative way, I would be grateful to receive information and make a rollback/corrections.

@7-zete-7 7-zete-7 marked this pull request as draft April 9, 2025 19:32
@7-zete-7
Copy link
Contributor Author

7-zete-7 commented Apr 9, 2025

Converted to Draft until the issues that arose are resolved.

docker compose up --pull always -d --wait
docker compose up --wait
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pulling the image was not required here. At the time of these steps, the images should be both built/pulled. I can assume that this was done in order to maintain a uniform format for the docker compose up command.

echo 'To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build -d --wait'
echo 'To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build --wait'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The --build option to the docker compose up command makes sense in this case. The Dockerfile can be changed after Symfony Flex actions.

@7-zete-7 7-zete-7 marked this pull request as ready for review April 10, 2025 15:11
@7-zete-7
Copy link
Contributor Author

The issues have been resolved at this time. Additional comments are welcome.

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