Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Daemon command dockerd not found on latest stable Docker for Mac and Docker Toolbox #27102

Closed
ltfschoen opened this issue Oct 3, 2016 · 21 comments
Labels
area/cli exp/beginner kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@ltfschoen
Copy link

ltfschoen commented Oct 3, 2016

Description

After installing the latest version of Docker for Mac or the Docker Toolbox, we cannot control the Docker Daemon via the dockerd binary dockerd, as the command cannot be found.

Steps to reproduce the issue:

  1. Download and install Docker for Mac version 1.12.1, build 6f9534c (OR Docker for Mac version 1.12.0, build 8eab29e, OR Docker Toolbox v1.12.0)
  2. Run docker -v to see terminal output Docker version 1.12.1, build 6f9534c
  3. Identify where Docker installed with which docker to see the following terminal output:
    /usr/local/bin/docker
  4. Run the old docker daemon subcommand (that was used in previous Docker versions prior to v1.12 to control the Docker Daemon) using the latest Docker executable sudo /usr/local/bin/docker daemon to be prompted to enter root password and see the following terminal output:
    Password: 'docker daemon' is not supported on Darwin. Please run 'dockerd' directly
  5. Run the Docker Daemon via the dockerd binary (as suggested by the latest stable version of Docker in the above terminal output), to see the following terminal output:
    -bash: dockerd: command not found
  6. Uninstall Docker for Mac from within the GUI (Preferences / Uninstall) and then drag the Docker application from ~/Applications into Trash. Uninstall Docker Toolbox by downloading the Docker Toolbox Uninstall Shell Script and executing it with sudo bash uninstall.sh

Describe the results you received:
dockerd command not found after installing latest stable version of Docker for Mac or Docker Toolbox.

Describe the results you expected:

  • If the dockerd command should not be available after installing Docker for Mac or Docker Toolbox, then running the old docker daemon subcommand on the latest stable version of Docker should not show a terminal output suggesting to the user to Please run 'dockerd' directly when that command cannot be found after installing the latest stable version of Docker.
  • If the dockerd command should be available after installing Docker for Mac or Docker Toolbox, then the dockerd command should be found after installing the latest stable version of Docker for Mac or Docker Toolbox.
  • If the dockerd command is not supported by Darwin, then it should not suggest to the user to Please run 'dockerd' directly in the same terminal output message where it has already stated that it has determined that the user is using Darwin.
  • If the fact that it displays Please run 'dockerd' directly in the terminal output is a bug, and the Docker Daemon is no longer controlled by the dockerd command on Darwin, then a more accurate message should be provided to the user highlighting how they may control the Docker Daemon

Additional information I deem important:

Output of docker version:

Docker version 1.12.1, build 6f9534c

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 0
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host overlay null
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.20-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.953 GiB
Name: moby
ID: I2BN:2PEK:CPZO:B5LN:R7IR:ERRF:N6WL:VPCV:KQJN:UGOW:4JPD:VQM2
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 16
 Goroutines: 27
 System Time: 2016-10-03T02:30:44.782667221Z
 EventsListeners: 1
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

Output of sw_vers:

ProductName:    Mac OS X
ProductVersion: 10.11.5
BuildVersion:   15F34

Output of uname -amnprsv and sw_vers:

Darwin Kernel Version 15.5.0
RELEASE_X86_64 x86_64 i386
ProductName:    Mac OS X
ProductVersion: 10.11.5
BuildVersion: 15F34
@thaJeztah thaJeztah added area/cli kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Oct 3, 2016
@thaJeztah
Copy link
Member

Thanks for reporting; yes, Docker for Mac should probably print a different message, also, we may need to check if the CLI is on the same "host" as the daemon, and print a different message based on that (as running dockerd wont work if the daemon is on a remote server).

/cc @dnephin @justincormack

@justincormack
Copy link
Contributor

I think on Darwin it should never suggest to run dockerd.

@ltfschoen the daemon runs in a Linux virtual machine, so you do not need to (and cannot) run it manually. It is already running of the whale is in the top bar.

@martinm82
Copy link

I have a similar issue. I have installed Docker for Mac via ssh on my machine and tried to run it. Using open -c Docker does not start up anything. Based on the documentation I see that you should do it via the UI but as said I have only access via ssh. The reason behind is that we want to automate provisioning of our Mac nodes by using Ansible and for that reason need to be able to configure Docker for Mac from command line.

Any hints are appreciated.

Thanks

@thaJeztah
Copy link
Member

@martinm82 could you open an issue for that in the docker for mac issue tracker? https://github.com/docker/for-mac/issues

@zmackie
Copy link

zmackie commented Feb 15, 2017

I started working on a PR for this, but I was wondering what the message should actually say on darwin?

@ayb
Copy link

ayb commented Feb 18, 2017

I ran into this issue too (and was able to run docker -v etc.) but after more digging it turns out I installed the "Docker Toolbox" yet hadn't downloaded the actual "docker.dmg" app

Once I downloaded it here everything began working for me:
https://download.docker.com/mac/stable/Docker.dmg

@JimLynchCodes
Copy link

I am also having tons of issues with this after installing with brew install docker. After that docker is a command, but dockerd is not. When I try to run other programs it tells me I need to "start the docker daemon running"...

I guess installing docker with brew is not the way to go!! 😞 😢

@ShlomiRex
Copy link

Its almost 2022
And I still don't have dockerd:
'zsh: command not found: dockerd'
Even if I used docker and have it installed properly.

@cpuguy83
Copy link
Member

@ShlomiRex dockerd will probably never be available for mac. dockerd is only supported on Linux and Windows. On Mac dockerd runs inside a Linux VM.

What is the impetus for trying to run dockerd? Error message from the docker command?

@paulinechi
Copy link

I have docker version 20.10.0, build 7287ab3 installed on macOS, and if I run 'docker run hello-world', there's an error message saying: 'docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.' can I ignore it if I'm just planning on using docker and docker-compose? :(

@thaJeztah
Copy link
Member

@paulinechi it means that the docker cli (or docker-compose) is not able to connect to the daemon. This could be if you have Docker Desktop installed, but it's not running. You need the docker daemon (which in the "Docker Desktop" situation is in a VM) running to use docker.

@thaJeztah
Copy link
Member

I'm closing this ticket, because the current behaviour is as expected. I think this was originally opened when the docker cli still had a daemon subcommand (during the transition from a single binary to separate binaries for the cli and daemon), which is no longer the case.

The dockerd binary, which is the docker daemon, is not available for macOS (and unlikely will be), because it's a Linux binary that (on Docker Desktop for Mac) runs inside the Docker Desktop VM.

@raphaelmatto
Copy link

raphaelmatto commented Apr 5, 2022

I'm having this exact same issue on the most recent MacOs version (Monterey, Version 12.3.1 (21E258)). I've uninstalled Docker & reinstalled several times, if I run docker ps or docker run hello-world as paulinechi describes, I get that same error: docker: Cannot connect to the Docker daemon at tcp://35.215.110.128:2375. Is the docker daemon running?.. Docker Desktop is running & I get a green light in the system tray. If anyone knows how to fix this, please help, else I'm considering wiping my mac & starting from scratch, but that will put me back a week or more.

@thaJeztah
Copy link
Member

@raphaelmatto make sure you don't have a DOCKER_HOST environment variable set; from that error, it looks like either you have a DOCKER_HOST env-var, or possibly a docker context that defines a non-standard location to connect to the daemon. The default should be to connect with the Engine API using a unix-socket (unix:///var/run/docker.sock)

@raphaelmatto
Copy link

raphaelmatto commented Apr 6, 2022

@thaJeztah that was it—you're a hero. I forgot I was pointing to a DOCKER_HOST on a remote machine that has since shut down. & it was staring me right in the face. Anyway, you saved me a lot of trouble.

@thaJeztah
Copy link
Member

Whoop! Glad to hear it helped 🎉

@Stephensteefin
Copy link

hello @thaJeztah i have similar issue

docker info :
Client:
Context: desktop-linux
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.10.0-docker)
compose: Docker Compose (Docker Inc., v2.15.1)
scan: Docker Scan (Docker Inc., v0.23.0)

Server:
ERROR: Cannot connect to the Docker daemon at unix:///home//.docker/desktop/docker.sock. Is the docker daemon running?
errors pretty printing info

@vanvietngo
Copy link

thanks everyone

@AndrianD
Copy link

AndrianD commented Nov 23, 2023

Hello everyone,
I'm under macos Silicon M2 and the question is simple:
is it possible to run the dockerd command under macos without it returning: "command not found: dockerd ?

Thank you very much for your answers!

@thaJeztah
Copy link
Member

Not directly possible; Linux containers require a Linux kernel, so on macOS, the actual containers (and the dockerd daemon) runs inside a VM, not on the macOS host.

(We have considered experimenting with a "fake" dockerd that could act as a proxy to control/configure the daemon inside the VM, but that was more of a "fun exercise").

@sarmstead
Copy link

So, I landed on this issue because I wanted to start the Docker daemon programmatically through my terminal. That way I could run docker-compose up when starting a local environment container and not run into the nefarious error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

After reviewing the Docker daemon documentation, I thought I needed to use dockerd to start the daemon manually. After reading the discussion in this issue (in particular the notes from @thaJeztah, #27102 (comment)), it appears that dockerd is simply not available for Mac.

To remedy the situation, you can simply run open /Applications/Docker.app to start the Docker desktop app on Mac. Doing this starts up the Docker daemon in the Docker Desktop VM (?).

A bit confusing, but it does clear the daemon errors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli exp/beginner kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests