Docker Compose V2 breaking changes - environment file handling issue

Viewed 1107

Docker Compose V2 has breaking changes due to which it throws an error (example given below), while parsing environment file.

Example - Apache Druid

Druid's docker compose fails with the below error when using the sample environment file.

unexpected character "\"" in variable name near "\"druid-datasketches\"
1 Answers

There are two potential solutions.

  1. Change the environment file by replacing all double quotes with single quotes and by wrapping these environment variables with a double quote (example - works with V2 as well as V1.x)
  2. Disable Docker Compose V2 in Docker Preferences > General > Uncheck "Use Docker Compose V2" or by running the command docker-compose disable-v2
Related