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

Conflicting explanation about auto-starting profiles and dependencies #20995

Open
1 task done
chbrandt opened this issue Sep 25, 2024 · 0 comments
Open
1 task done

Conflicting explanation about auto-starting profiles and dependencies #20995

chbrandt opened this issue Sep 25, 2024 · 0 comments
Labels
area/compose Relates to docker-compose.yml spec or docker-compose binary

Comments

@chbrandt
Copy link
Contributor

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

In section how-tos / profiles / Auto-starting profiles and dependencies resolution, I believe the first example of compose is missing a profiles: [tools] argument under db service. For it says in the command-line example below (in the comment): This runs db-migrations (and,if necessary, start db) by implicitly enabling the profiles 'tools'.

The second example has it right (according to the example comment).

Location

https://docs.docker.com/compose/how-tos/profiles/

Suggestion

If that is the case -- i.e., when explicitly starting a compose service from the command-line depends_on is not resolved but profiles is --, the first example compose should read:

services:
  backend:
    image: backend

  db:
    image: mysql
    profiles: [tools]

  db-migrations:
    image: backend
    command: myapp migrate
    depends_on:
      - db
    profiles:
      - tools

for the command-line comment (without the parenthesis) to be satisfied:

# This runs db-migrations and,if necessary, start db
# by implicitly enabling the profiles `tools`
$ docker compose run db-migrations
@chbrandt chbrandt added the status/triage Needs triage label Sep 25, 2024
@aevesdocker aevesdocker added area/compose Relates to docker-compose.yml spec or docker-compose binary and removed status/triage Needs triage labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/compose Relates to docker-compose.yml spec or docker-compose binary
Projects
None yet
Development

No branches or pull requests

2 participants