Skip to content

config should output both .env and .yml #11873

Closed

Description

@nagkumar

Description

docker compose  --env-file %DIR_ESN_CMN_SUP%/support.env ^
               --env-file %DIR_ESN_APM%/es-apm.env ^
               -f %DIR_ESN_APM%/es-apm-compose.yml ^
               -f %DIR_ESN_LOCUST%/locust-compose.yml ^
               --env-file %DIR_ESN_ESC%/esc.env ^
	       -f %DIR_ESN_ESC%/esc-compose.yml ^
	       --env-file %DIR_ESN_FE%/fe.env ^
	       -f %DIR_ESN_FE%/fe-compose.yml ^
	       --env-file %DIR_ESN_MANUAL_LOGIN%/login.env ^
	       -f %DIR_ESN_MANUAL_LOGIN%/login-compose.yml ^
              --env-file %ESN_MANUAL_SB%/DIR_RT_ESN_MANUAL.env ^
               -f %ESN_MANUAL_SB%/DIR_RT_ESN_MANUAL-compose.yml config  

In order to have the best value from the options --env-file & -f to keep the xxx-compose.yml files smaller, it would be needed to see both .env and final yml file through config, current config just gives environment variables meged.. this has two problems

  1. Information is lost as there is no .env file
  2. if doing automation from shell script or batchfile, all the env values are lost..

Do consider to change config to output separate .env and .yml file

Activity

  1. ndeloof commented on Jun 3, 2024

    @ndeloof
    Contributor

    config command role is to let you get the actual compose model to be applied on your infrastructure. Values in env file that don't get used here are not "lost", they just aren't used by compose and won't have any impact on your deployment.

    Please explain why you would like to see the "merged" env file.

    We could introduce a dedicated docker compose config --environment command to dump the project environment, as a merge of all env sources.

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

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