[ 
https://issues.apache.org/jira/browse/HDDS-6326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17523943#comment-17523943
 ] 

Neil Joshi edited comment on HDDS-6326 at 4/18/22 11:25 PM:
------------------------------------------------------------

I've run into the same problem with a local environment.  V2 docker-compose 
does not work with variables having characters `-,.` non-alphanumeric character.

Ubuntu 18.04 with _Docker Compose v1 1.27.4_ originally, but since HDDS-6490 
patch needed to support *-ansi=None* ({*}-no-ansi{*} {_}deprecated{_}) and 
upgraded docker-compose to _Docker Compose v2 2.4.1 ._  Unfortunately, Docker 
Compose v2 does not support non alphanumeric characters in the environment 
variable keys.

The problem occurs in V2 docker-compose since the .env file parser changed from 
a python based parser to a dotenv golang parser supposedly compatible with the 
ruby dotenv library.  This new parser *_only_* accepts environment variable 
keys containing *A-Za-z0-9_* regardless whether it is escaped or quoted.  

 

This is a bug in the docker-compose implementation, as it is _supposed_ to be 
compatible with dotenv golang library 
([https://github.com/joho/godotenv)|https://github.com/bkeepers/dotenv)] that 
passes our environment variable file (docker-config, all OZONE-SITE prefixes).  
Our docker-compose environment variable files should properly be parsed if the 
docker V2 implementation is compatible with dotenv.   See docker-compose 
parser: locateKeyName function for error - 
[https://github.com/compose-spec/compose-go/blob/49e6127e40d8c5003678bc7cbdb2325bdd83dac1/dotenv/parser.go#L107]

This is a bug that should be fixed by the docker-compose V2 maintainers - 
[~adoroszlai] ?


was (Author: neiljoshi):
I've run into the same problem with a local environment.  V2 docker-compose 
does not work with variables having characters `-,.` non-alphanumeric character.

Ubuntu 18.04 with _Docker Compose v1 1.27.4_ originally, but since HDDS-6490 
patch needed to support *-ansi=None* ({*}-no-ansi{*} {_}deprecated{_}) and 
upgraded docker-compose to _Docker Compose v2 2.4.1 ._  Unfortunately, Docker 
Compose v2 does not support non alphanumeric characters in the environment 
variable keys.

The problem occurs in V2 docker-compose since the .env file parser changed from 
a python based parser to a dotenv golang parser supposedly compatible with the 
ruby dotenv library.  This new parser *_only_* accepts environment variable 
keys containing *A-Za-z0-9_* regardless whether it is escaped or quoted.  

 

This is a bug in the docker-compose implementation, as it is _supposed_ to be 
compatible with dotenv ruby library ([https://github.com/bkeepers/dotenv)] that 
passes our environment variable file (docker-config, all OZONE-SITE prefixes).  
Our docker-compose environment variable files should properly be parsed if the 
docker V2 implementation is compatible with dotenv.   See docker-compose 
parser: locateKeyName function for error - 
[https://github.com/compose-spec/compose-go/blob/49e6127e40d8c5003678bc7cbdb2325bdd83dac1/dotenv/parser.go#L107]

This is a bug that should be fixed by the docker-compose V2 maintainers - 
[~adoroszlai] ?

> Docker Compose v2 Compatiblity
> ------------------------------
>
>                 Key: HDDS-6326
>                 URL: https://issues.apache.org/jira/browse/HDDS-6326
>             Project: Apache Ozone
>          Issue Type: Task
>          Components: docker
>            Reporter: Siyao Meng
>            Priority: Major
>
> Currently most docker-compose.yaml / docker-config files aren't compatible 
> with Docker Compose v2, due to the widely used "-" in docker-config files.
> It would be great to work around this, by either:
> 1) Wrap around conf XML addition lines with double quotes (would this work?)
> 2) Replace "-" with something else compatible
> Thoughts?
> CC [~adoroszlai]
> Note: Also update wiki page accordingly 
> https://cwiki.apache.org/confluence/display/OZONE/Ozone+Docker+images



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to