Skip to content

[BUG] COMPOSE_FILE env var is not honored #1728

@olivierdalang

Description

@olivierdalang

Expected Behavior

kompose should honor the COMPOSE_FILE env var.

In short, this envvar allows to define which yamls to load by default instead of the default docker-compose.yml if no -f params are given. It is a nice alternative to explicitly set them with -f each time you run a docker compose command.

Actual Behavior

Currently kompose ignores COMPOSE_FILE (and just defaults to docker-compose.yml if -f is not set)

Steps To Reproduce

  1. Create a docker-compose.yml and a docker-compose.alternative.yml configs that have visible differences
  2. Run COMPOSE_FILE=docker-compose.alternative.yml kompose convert -o output.yml
  3. See that the docker-compose.yml was converted

Kompose Version

1.31.1 (46dcb9181)

Docker-Compose file

# docker-compose.yml
version: "3"
services:
  test:
    image: debian
---
# docker-compose.alternative.yml
version: "3"
services:
  test:
    image: alpine

Anything else?

No response

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions