skip to Main Content

I’m currently running docker desktop version 20.10.22 (build 3a2c30b, fresh install) on Windows (using wsl2), but docker compose commands with the -f flag do not work correctly. Since I’m using docker compose V2 (checked the option in the docker desktop settings), my commands are with a space instead of a hyphen. I get the following message when running any docker compose command using -f:

unknown shorthand flag: ‘f’ in -f See ‘docker –help’.

Specifically, I’m running the FIWARE NGSI-LD tutorials. All docker compose commands that are used within those tutorials fail. The commands can be found in the services file for each tutorial. For example, a command that fails (saying that the -f flag does not exist) within the Short-Term-History tutorial is the following:

docker compose -f docker-compose/mintaka.yml -p fiware up -d --remove-orphans --renew-anon-volumes

The weird thing is that docker compose --help and docker compose --version both return the output from respectively docker --help and docker --version, as if it excludes the compose keyword. The output of the above command also refers to the standard docker help command instead of the docker compose help.

UPDATE: Docker excludes the compose keyword between docker and the rest of the command. Replacing compose with a random string of letters gives the same effect. It seems as if it cannot recognize the compose keyword.

The old docker-compose is not installed so that does not work either. Running which docker-compose returns the docker-compose.exe location, inside the .../Docker/resources/bin folder. Running which docker compose returns the location of docker.exe. The .../Docker/resources/bin folder is inside the path environment variable.

Does anybody know what the problem might be? I’ve searched countless websites but did not find any solutions for this problem yet.

Kind regards

2

Answers


  1. Chosen as BEST ANSWER

    I reinstalled docker desktop with the same installer (also same version) and this resolved the problem weirdly enough...

    The only difference between my old and new installation was that I already had wsl2 installed this time.


  2. Here is what I have in running processes when I run docker compose events:

    docker compose processes

    Please check if you have all these directories and files. Then we can troubleshoot further.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search