Skip to content

[BUG] compose publish fails if env_file is missing #13382

@llamafilm

Description

@llamafilm

Description

When running docker compose publish if the env_file is missing it fails with this error:

env file /home/runner/work/high-desert-happenings/high-desert-happenings/.envs/.production/.django not found: stat /home/runner/work/high-desert-happenings/high-desert-happenings/.envs/.production/.django: no such file or directory

I believe the env_file is not needed for publishing, and it would be scary if it were because that's where I store secrets. Example file:

services:
  django:
    build:
      context: .
      dockerfile: ./compose/production/django/Dockerfile
    image: ${REGISTRY}/${IMAGE_NAME}-django:latest
    env_file:
      - ./.envs/.production/.django
    command: /start

Steps To Reproduce

No response

Compose Version

Docker Compose version v2.40.0-desktop.1

Docker Environment


Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions