Sami Al-Subhi
Sami Al-Subhi

Reputation: 4672

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

Upvotes: 18

Views: 41437

Answers (11)

GarryOne
GarryOne

Reputation: 1488

On Debian I had the exact same error after a manual binary installation.

Even if my binary was inside the /usr/bin which was already in the PATH, it still was not working. Running /usr/bin/docker was working though.

It turned out that I had the binary in both /usr/bin/docker and /usr/local/bin/docker.

I had to have instead a symlink between these 2 paths, rather than 2 independent binaries.

So I removed the /usr/local/bin/docker file and added instead a symlink from the /usr/bin/docker

ln -s /usr/bin/docker /usr/local/bin/docker

Upvotes: 0

Sujay
Sujay

Reputation: 375

For those who may come with similar error for e.g.

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

You may need to install the docker engine separately, atleast true in my case (using Arch linux). Thanks!

Upvotes: 1

mmsilviu
mmsilviu

Reputation: 1461

An alternative to Docker Desktop is colima, container runtimes on macOS (and Linux) with minimal setup.

# Homebrew
brew install colima docker

colima start

Now, you can use the docker commands as before.

For docker compose commands, you have to install:

brew install docker-compose

Upvotes: 0

olusegvn
olusegvn

Reputation: 21

Ensure that docker CLI is installed not just docker desktop on Linux. YOu can install it using:

sudo apt install docker.io

Upvotes: 2

apokryfos
apokryfos

Reputation: 40730

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 recommend installing docker-compose cli to fix this issue, but to share some insights in case this is applicable to you as well.

Upvotes: 6

Amir Shitrit
Amir Shitrit

Reputation: 1862

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.

Upvotes: 0

Hannes Oberreiter
Hannes Oberreiter

Reputation: 681

Updated Answer:

Since VSCode Docker 1.14.0 you can now set the Docker executable path in the settings, which should help in most cases.

VSCode Setting, Docker Path


Old Answer (Option was removed from Docker Desktop):

The Desktop Docker Version 2.4.0.0 is working for me after I did deactivate the feature Enable cloud experience. You can find it under Preferences --> Command Line.

Cloud Experience


If you are still experience the problem, you may try a clean remove and install of Docker and also make sure that Docker is actually running, see other possible solution(s) here.


History of GitHub Issues:

Upvotes: 13

Doug
Doug

Reputation: 1

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 ~ % 

Upvotes: 0

Kenny Trytek
Kenny Trytek

Reputation: 41

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.

Upvotes: 0

Urvashi
Urvashi

Reputation: 9

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.

Upvotes: -1

vintagexav
vintagexav

Reputation: 2057

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

Upvotes: 8

Related Questions