How to solve "Can't separate key from value" in docker

Viewed 3766

After upgrading my docker desktop, I get an error when running docker-compose up. My usual setup consists of microservices controlled with the docker-compose command. When I run docker-compose up, all the containers are started. After updating my docker desktop, I get:

Can't separate key from value 

while running docker-compose up. How do I fix this?

3 Answers

Check for the version number of docker and if its 3.4+ then the docker compose v2 is enabled by default. To disable it, go to > docker desktop > preferences > experimental features > un-check "use Docker Compose V2" option. This is a move by docker hub to incorporate docker-compose as docker compose and may cause problems to your usual workflow. Enjoy :)

Just in case if anyone else (like me) run into this issue:

Check the local (to docker-compose.yaml) .env file, is there a VARIABLE without mapping? If so... remove it or give it a value...

More specifically maybe:

MY_VAR=  // works fine
MY_VAR2  // fails
; MY VAR // also fails
; MY_VAR=  // works, but fails later with an actually useful msg
Related