Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose failing to read env_file with UTF8 BOM #5220

Closed
vtortola opened this issue Sep 27, 2017 · 1 comment
Closed

docker-compose failing to read env_file with UTF8 BOM #5220

vtortola opened this issue Sep 27, 2017 · 1 comment

Comments

@vtortola
Copy link

vtortola commented Sep 27, 2017

Hi!

I was trying to use the env_file feature in docker-compose but the environment variables were not being readed from the file.

In this example project you will see two files named config.env and config2.env. They almost contains the same data, but config.env starts with the UTF8 BOM, causing docker-compose to not read the variables.

Most text editors shows the same content for both files.

During the execution, the log shows that something is going wrong with the parsing:

config.env:

    environment:
      NUGET_FALLBACK_PACKAGES: /root/.nuget/fallbackpackages
      "\uFEFFTEST": Compose

config2.env

    environment:
      NUGET_FALLBACK_PACKAGES: /root/.nuget/fallbackpackages
      TEST: Compose

Would it be possible for docker in general to be aware of the UTF8 BOM in configuration files?

How did happen?

Well it seems that when you add a text file in Visual Studio, it adds the UTF8 BOM by default. I generated the second file that has to BOM using the Windows Explorer contextual menu "New File".

Maybe: StackOverflow: Reading Unicode file data with BOM chars in Python

@vtortola vtortola changed the title docker-compose silently failing when reading a env_file with UTF8 BOM docker-compose failing to read env_file with UTF8 BOM Sep 27, 2017
@shin- shin- added this to the 1.18.0 milestone Oct 24, 2017
@shin-
Copy link

shin- commented Oct 24, 2017

Thank you for the report!

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

No branches or pull requests

2 participants