You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When checking the validity of a compose file with the docker compose config command, passing the --no-interpolate option to avoid interpolating environment variables, docker compose v2 turns all the $ characters into $$, making the normalized resulting compose file unable to later be provided with values for the environment variables.
This is different from the behaviour of docker-compose config v1 which was not escaping the environment variables dollar sign in that way.
I have the same problem and have been trying to figure out what it is. After some research, it seems that it comes from the Convert function in pkg/compose/compose.go. This function calls escapeDollarSign and that's the reason why the $ is escaped. I compiled docker-compose without the call to escapeDollarSign and the behavior returned as in v1.
When checking the validity of a compose file with the docker compose config command, passing the --no-interpolate option to avoid interpolating environment variables, docker compose v2 turns all the $ characters into $$, making the normalized resulting compose file unable to later be provided with values for the environment variables.
This is different from the behaviour of docker-compose config v1 which was not escaping the environment variables dollar sign in that way.
Steps to reproduce the issue:
1.
Describe the results you received:
MY_ENV_VAR: $$ENV_VAR
Describe the results you expected:
MY_ENV_VAR: $ENV_VAR
Note that the --compatibility flag doesn't change that behaviour.
Output of
docker compose version
:Output of
docker info
:Behavior of docker-compose v1 for comparizon:
1.
The text was updated successfully, but these errors were encountered: