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] COMPOSE_PROFILES not read from env file if --env-file flag is passed #11955

Closed
mohan-13 opened this issue Jul 2, 2024 · 3 comments
Closed

Comments

@mohan-13
Copy link

mohan-13 commented Jul 2, 2024

Description

Current Behaviour:
When --env-file flag is passed from the command line and COMPOSE_PROFILES is specified in the env file, the value is not used for the profiles configuration.

Expected Behaviour:
The COMPOSE_PROFILES value specified in the env file should be set as the profile configuration and respective containers should be started.

Steps To Reproduce

Configuration Files:
docker-compose.yml

services:
  nginx1:
    image: nginx
    profiles:
      - nginx1
  nginx2:
    image: nginx
    profiles:
      - nginx2

.env.dev

COMPOSE_PROFILES=nginx1,nginx2

When we run
docker compose --env-file .env.dev up -d
a message
no service selected is thrown.

But both the services nginx1,nginx2 should be started.

Compose Version

docker compose version:
Docker Compose version v2.27.1-desktop.1

docker-compose version:
Docker Compose version v2.27.1-desktop.1

Docker Environment

Server:
 Server Version: 26.1.4
 Storage Driver: overlay2 
 Kernel Version: 6.6.31-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 Name: docker-desktop

Client:
 Version:    26.1.4
 Context:    desktop-linux
 Debug Mode: false

Anything else?

No response

@ShadowLNC
Copy link

Duplicate #11856

@eliiphaz
Copy link

A pull request about has been merged about that, I think it fixes your issue @mohan-13 because it same with #11856 closed now

@jhrotko
Copy link
Contributor

jhrotko commented Jul 18, 2024

Hello, @mohan-13

I checked for version v2.28.1 and it's working as expected.

Screenshot 2024-07-18 at 10 29 55

Thank you for your contribution!

@jhrotko jhrotko closed this as completed Jul 18, 2024
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

4 participants