'exec: "com.docker.cli": executable file not found in $PATH

I am getting this error when docker-compose up on one of the containers only.

exec: "com.docker.cli": executable file not found in $PATH
The terminal process "/bin/zsh '-c', 'docker logs -f f6557b5dd19d9b2bc5a63a840464bc2b879d375fe72bc037d82a5358d4913119'" failed to launch (exit code: 1).
  1. I uninstalled and reinstalled docker [email protected] on Mac
  2. docker-compose build from scratch
  3. other containers are running
  4. I get the above error.
  5. It used to be running. I am not sure why this is happening. I know that I upgraded docker from I think 2.3
  6. also I think I received an update on my mac

Dockerfile

FROM tiangolo/uvicorn-gunicorn:python3.8
COPY requirements.txt /app/
RUN pip install -r requirements.txt

COPY ./app /app/app
#COPY config.py /app/app/

docker-compose.yml

version: "3"

services:
    postgresql:
        container_name: postgresql
        image: postgres:12
        ports:
            - "5433:5432"
        environment:
            - POSTGRES_USER=${POSTGRES_USER}
            - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
            - POSTGRES_DB=${POSTGRES_DB}
        volumes:
            - ./postgres-data:/var/lib/postgresql/data
    fastapi:
        build:
            context: ./fastapi/
            dockerfile: Dockerfile
        volumes:
            - ./fastapi/app/imgs:/app/app/imgs
        ports:
            - "1001:80"
        depends_on:
            - postgresql
        env_file:
            - .env
    pgadmin:
        container_name: pgadmin
        image: dpage/pgadmin4
        environment:
            - [email protected]
            - PGADMIN_DEFAULT_PASSWORD=admin
        ports:
            - "5050:80"
        depends_on:
            - postgresql

    solr:
        build:
            context: ./solr/
            dockerfile: Dockerfile
        restart: always
        ports:
            - "8983:8983"
        volumes:
            - data:/var/solr
volumes:
    data:

update: It worked when I downgraded to docker desktop 2.3.0.4



Solution 1:[1]

You might get the following error message simply because you did not start Docker just yet

exec: "com.docker.cli": executable file not found in $PATH

Solution 2:[2]

In my case the problem was I had installed and then crudely removed the docker compose cli. This resulted in the above error to start popping up.

I got the compose CLI back using instructions from https://docs.docker.com/cloud/ecs-integration/#install-the-docker-compose-cli-on-linux and running (as root):

curl -L https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh

This fixed it for me.

Note: I would not reccomend installing docker-compose cli to fix this issue, but to share some insights in case this is applicable to you as well.

Solution 3:[3]

Update: The "cloud experience" no longer exists even as an experimental feature in Docker Desktop v3.2.1. This should no longer be an issue.

If you continue to see this problem on a newer version, you will need to downgrade to Docker v3.1.0, disable the cloud experience feature, then upgrade to the newest version.

Solution 4:[4]

Had the exact same issue. Was fixed after starting the upgraded docker first, then running this command.

dostarr@DOSTARR-M-38LF ~ % docker run busybox
exec: "com.docker.cli": executable file not found in $PATH
<started docker>
dostarr@DOSTARR-M-38LF ~ % docker run busybox                           
dostarr@DOSTARR-M-38LF ~ % 

Solution 5:[5]

I had the same problem when trying to run minikube tunnel, and since I didn't want to re-install anything, I ended up running it from the docker bin path (on Windows it's in 'C:\Program Files\Docker\Docker\resources\bin') and it worked.

Solution 6:[6]

if already have installed docker, it may not have started. So type in terminal,"docker run -d -p 80:80 docker/getting-started" and it should solve the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vintagexav
Solution 2 apokryfos
Solution 3
Solution 4 eyllanesc
Solution 5 Amir Shitrit
Solution 6 Urvashi