18

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

2
  • 1
    I had the same issue and downgrading to 2.3.0.4 helped me as well. I created this issue: github.com/docker/for-mac/issues/4956 But then I updated it again via automatic updates to version 2.4.0.0 and the second time it kept working. Commented Oct 1, 2020 at 18:35
  • I think dockerfile and docker-compose config are not related to the problem and should be excluded from the question. Commented Nov 10, 2020 at 17:11

11 Answers 11

13

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:

Sign up to request clarification or add additional context in comments.

2 Comments

I confirm this solution works using MacOs Catalina 10.15.6, with Docker Desktop 3.1.0
Does not work for me on Manjaro 21.3.7 Ruah with Docker Desktop 4.12.0
8

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

1 Comment

so how to start it
6

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.

3 Comments

This fixed it for me, and IMO should be the solution.
@apokryfos the disclaimer note you've put in your answer creates a lot of questions
@AteSomebits to clarify what I mean. I encountered this problem because I had installed docker-compose and then removed it improperly and this solution should work in that case. If you never installed docker-compose in the past then installing it now will probably not solve the issue.
3

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

sudo apt install docker.io

Comments

1

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!

Comments

0

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.

Comments

0

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

Comments

0

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.

Comments

0

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

Comments

0

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

Comments

-1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.