compose icon indicating copy to clipboard operation
compose copied to clipboard

[BUG] Docker Compose pull fails when a required env_file is missing

Open KostaGorod opened this issue 6 months ago • 1 comments

Description

I Believe this is part of previous requests https://github.com/docker/compose/issues/1973 & https://github.com/docker/compose/issues/9181.

which defines that some commands don't need to validate full config.

my issue that when I pull images, using env_file with required=true. the pull fails due to missing env file.

My expectation is that the required is part of running the compose (and validating), not pulling. If there is situation that env_file is expected as part of pull (which I'm not aware of such situations), I would expect option to declare that its required only for commands such up but ignored for pull. for example required: "runtime"

Steps To Reproduce

  1. add to docker-compose.yml
env_file:
  - path: .myservice.env
    required: true
  1. run docker compose pull
  2. command fails due to missing file. - undesired behavior
  3. edit to required: false
  4. command succeeded.
  5. but now docker compose up ignores missing file as well

Compose Version

Docker Compose version v2.25.0

Docker Environment

No response

Anything else?

No response

KostaGorod avatar Aug 25 '24 11:08 KostaGorod