Docker Community Forums

Share and learn in the Docker community.

Running docker as 'sudo docker'


(Briteneon) #1

I moved from boot2docker to Docker for Mac and my scripts have started to fail.
In boot2docker, I had my DOCKER_HOST set and sudo docker commands worked like a charm.

With the Docker for Mac, I am not able to do the same. How do I query the daemon IP? How to disable TLS in docker for mac?
When I run docker daemon, it shows that I need to run dockerd instead.

Expected behavior

sudo docker commands must have worked

Actual behavior


  • the output of:
    • Moby Menu > Diagnose & Feedback on OSX
  • a reproducible case if this is a bug, Dockerfiles FTW
  • page URL if this is a docs issue or the name of a man page
  • host distribution and version ( OSX 10.10.x, OSX 10.11.x, Windows, etc )

Steps to reproduce the behavior

(David Sheets) #2

Docker for Mac runs as your regular OS X user. You do not need to use sudo and you do not need to set DOCKER_HOST. In fact, you must unset DOCKER_HOST for Docker for Mac to function correctly.

(Briteneon) #3

Thank you, that worked but I had to make a lot of changes to all the scripts that had ‘sudo’ in them.