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

[BUG] profiles have no effect on config with v2.24.7 #11587

Closed
luciangabor opened this issue Mar 7, 2024 · 4 comments
Closed

[BUG] profiles have no effect on config with v2.24.7 #11587

luciangabor opened this issue Mar 7, 2024 · 4 comments

Comments

@luciangabor
Copy link

Description

Whether a service has a profile or not has no effect on docker compose config - it always shows all services.

Steps To Reproduce

No response

Compose Version

Docker Compose version v2.24.7

Docker Environment

No response

Anything else?

No response

@luciangabor luciangabor changed the title [BUG] profiles have no effect on config with v.24.7 [BUG] profiles have no effect on config with v2.24.7 Mar 7, 2024
@luciangabor
Copy link
Author

Besides:

here's a couple more:

  • missing validation:
$ docker compose -f - config <<-'EOF'
name: no-build-or-image
services:
  service:
    read_only: true
EOF
name: no-build-or-image
networks:
  default:
    name: no-build-or-image_default
services:
  service:
    networks:
      default: null
    read_only: true

$ docker compose -f - config -q <<-'EOF'
name: no-build-or-image
services:
  service:
    read_only: true
EOF

$ echo $?
0
  • ineffective service argument
$ docker compose -f - config service1 <<-'EOF'
name: select-service
services:
  service1:
    image: service1
  service2:
    image: service2
EOF
name: select-service
networks:
  default:
    name: select-service_default
services:
  service1:
    image: service1
    networks:
      default: null
  service2:
    image: service2
    networks:
      default: null

@jhrotko jhrotko self-assigned this Mar 11, 2024
@jhrotko
Copy link
Contributor

jhrotko commented Mar 12, 2024

@luciangabor could you report a different issue with your last comment? It requires a more complex solution

@luciangabor
Copy link
Author

@jhrotko it's "a la carte" now, with this issue about the profiles and 3 more (#11606, #11607, #11608) for the default net, the missing validation and the config issues

$ docker compose -f - config <<-'EOF'
name: hidden
services:
  service:
    image: image
    profiles:
      - hidden
EOF
name: hidden
networks:
  default:
    name: hidden_default
services:
  service:
    image: image
    networks:
      default: null
    profiles:
      - hidden

# although --services works
$ docker compose -f - config --services <<-'EOF'
name: hidden
services:
  service:
    image: image
    profiles:
      - hidden
EOF

@ndeloof
Copy link
Contributor

ndeloof commented Mar 13, 2024

fixed by #11604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants