Search code examples
macosdockercommand-linecommand

Docker command not found when running on Mac


I'm trying to run the below code as instructed in the docker-graphite-statsd:

docker run -d\
 --name graphite\
 --restart=always\
 -p 80:80\
 -p 2003-2004:2003-2004\
 -p 2023-2024:2023-2024\
 -p 8125:8125/udp\
 -p 8126:8126\
 graphiteapp/graphite-statsd

It gives this error:

$ sudo docker run -d --name graphite --restart=always -p 80:80 -p 2003-2004:2003-2004 -p 2023-2024:2023-2024 -p 8125:8125/udp -p 8126:8126 graphiteapp/graphite-statsd
sudo: docker: command not found

This is on a Mac. I tried brew install docker but it made no difference.

How do I resolve this?


Solution

  • Run brew list which will show a list of all your installed Homebrew packages.

    But it's highly recommended to install docker using below link on your mac :

    https://docs.docker.com/docker-for-mac/install/