I've just install Docker on Mac OS 10.10.5 and ran Kitematic after that and got a hug error right away. This is the beginning of it, I can paste the rest if it will help
Command failed: /usr/local/bin/docker-machine -D start default,Docker
Machine Version: 0.7.0, build a650a40,Found binary path at
/usr/local/bin/docker-machine,Launching plugin server for driver
virtualbox,Plugin server listening at address 127.0.0.1:62284,()
Calling .GetVersion,Using API Version 1,() Calling .SetConfigRaw,()
Calling .GetMachineName,command=start machine=default,(default)
Calling .GetState,(default) DBG | COMMAND: /usr/local/bin/VBoxManage
showvminfo default --machinereadable,(default) DBG | STDOUT:,(default)
DBG
$ docker version
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Tue Apr 26 23:44:17 2016
OS/Arch: darwin/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Stopped Unknown
I've read the Get started with Docker Machine and a local VM one more time and found I need to run eval "$(docker-machine env default)" to setup the env-var for docker on Mac OS X.
Related
I just got a new Mac. My old Mac had a shell script that included these lines:
ACTIVE=`docker-machine active 2>/dev/null`
HOST_IP=`docker-machine ip $ACTIVE`
When I run this on the new machine it doesn't work. Just running the docker-machine active command independently I get output like this:
No active host found
I figured I try to create a default with docker-machine create default, but got this:
dial-http tcp 127.0.0.1:49719: unexpected EOF
I'm not sure what version of Docker my old Mac was running, but it was native. New Mac:
Client:
Version: 17.06.1-ce
API version: 1.30
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:53:38 2017
OS/Arch: darwin/amd64
Server:
Version: 17.06.1-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:54:55 2017
OS/Arch: linux/amd64
Experimental: true
New versions of Docker for Mac no longer user VirtualBox and docker-machine. It's running on xhyve and you can run docker commands very similar to if you were running docker natively on a linux host. There's still a VM under the covers (using moby), but your scripts shouldn't see that anymore. Anything you use to connect to published ports can now connect to localhost as if it is running directly on the Mac host.
Trying to setup docker from brew, however the engine does not seem to be included in any of the any of the official formulas.
brew install docker-machine docker-compose
So these only installs the clients?
Is there no keg with the engine/daemon?
The following steps work fine on macOS Sierra 10.12.4. Note that after brew installs Docker, the docker command (symbolic link) is not available at /usr/local/bin. Running the Docker app for the first time creates this symbolic link. See the detailed steps below.
Install Docker.
brew install --cask docker
Launch Docker.
Press ⌘ + Space to bring up Spotlight Search and enter Docker to launch Docker.
In the Docker needs privileged access dialog box, click OK.
Enter password and click OK.
When Docker is launched in this manner, a Docker whale icon appears in the status menu. As soon as the whale icon appears, the symbolic links for docker, docker-compose, docker-credential-osxkeychain and docker-machine are created in /usr/local/bin.
$ ls -l /usr/local/bin/docker*
lrwxr-xr-x 1 susam domain Users 67 Apr 12 14:14 /usr/local/bin/docker -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker
lrwxr-xr-x 1 susam domain Users 75 Apr 12 14:14 /usr/local/bin/docker-compose -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker-compose
lrwxr-xr-x 1 susam domain Users 90 Apr 12 14:14 /usr/local/bin/docker-credential-osxkeychain -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker-credential-osxkeychain
lrwxr-xr-x 1 susam domain Users 75 Apr 12 14:14 /usr/local/bin/docker-machine -> /Users/susam/Library/Group Containers/group.com.docker/bin/docker-machine
Click on the docker whale icon in the status menu and wait for it to show Docker is running.
Test that docker works fine.
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
$ docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Tue Mar 28 00:40:02 2017
OS/Arch: darwin/amd64
Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24 00:00:50 2017
OS/Arch: linux/amd64
Experimental: true
Please try running
brew install docker
This will install the Docker engine, which will require Docker-Machine (+ VirtualBox) to run on the Mac.
If you want to install the newer Docker for Mac, which does not require virtualbox, you can install that through Homebrew's Cask:
brew install --cask docker
open /Applications/Docker.app
To install Docker for Mac with homebrew:
brew install homebrew/cask/docker
To install the command line completion:
brew install bash-completion
brew install docker-completion
brew install docker-compose-completion
brew install docker-machine-completion
Docker desktop will not be installed if you run brew install docker. If you've already installed it this way, first uninstall with brew uninstall docker.
To install Docker Desktop, run:
brew install homebrew/cask/docker
Launch docker from your /Applications folder once and enter your password, then you can run commands like docker --version to verify the CLI is working.
Docker Desktop for Mac is not a suitable choice for enterprise docker users as it requires a paid license to use. Rancher Desktop is a viable open-source alternative for Docker Desktop for all three major OS.
Since this question is specifically targeted at Mac OS users, I have added the steps to make it work on Mac OS.
First install Docker using homebrew.
brew install docker
Install Rancher Desktop.
In Kubernates Settings, change container runtime to dockerd.
Profit !
UPDATE: There's another open-source container runtime in the scene, named Colima (https://github.com/abiosoft/colima).
For reinstall docker, you should run:
brew reinstall homebrew/cask/docker
I've tried to remove docker with this manual.
And I removed virtualbox. And then tried to install boot2docker.
After boot2docker init etc (by the manual on docker site)
docker run helloworld
gives me this error
Cannot connect to the Docker daemon. Is 'docker -d' running on this
host?
boot2docker status
running
docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): darwin/amd64
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
You need to run boot2docker up then docker run helloworld.
Boot2docker is not the recommended way of using Docker (on Windows/OS X) anymore (IMHO).
See Docker Machine instead (which can use the "boot2docker iso" internally, but not only).
You may also want to import your existing boot2docker environment (to keep your built images, etc.), it's possible too.
Then using Docker Machine, you can create a working Docker environment with the following commands:
On OS X (or an OS which supports eval and export commands), if you have the Docker CLI installed:
docker-machine create -d virtualbox dev
eval "$(docker-machine env dev)"
docker run hello-world
OR
On any OS, if you have not the Docker CLI installed:
docker-machine create -d virtualbox dev
docker-machine ssh dev
docker run hello-world
Maybe the daemon is not running?
Damiens-MacBook-Air:tmp damien$ docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): darwin/amd64
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
... check if the daemon is running :
Damiens-MacBook-Air:tmp damien$ boot2docker ssh sudo /etc/init.d/docker status
Docker daemon is not running
error in run: exit status 1
then start it :
Damiens-MacBook-Air:tmp damien$ boot2docker ssh sudo /etc/init.d/docker start
Need TLS certs for boot2docker,127.0.0.1,10.0.2.15,192.168.59.103
-------------------
and now you should be able to connect.
Damiens-MacBook-Air:tmp damien$ docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): darwin/amd64
Server version: 1.7.0
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 0baf609
OS/Arch (server): linux/amd64
Basically any changes I make while SSHed into the VM are lost at restart of the VM. I am assuming the problem is associated with the error when I stop the VM.
C:\Users\Tom>boot2docker stop
error in run: Failed to stop machine "boot2docker-vm": exit status 1
But, I may just be doing something dumb.
The sequence I followed is below (docker logo elided), you can see it losing the sample directory across the restart.
C:\Users\Tom>boot2docker up
Waiting for VM and Docker daemon to start.......................ooo
Started.
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\key.pem
Docker client does not run on Windows for now. Please use
"boot2docker" ssh
to SSH into the VM instead.
C:\Users\Tom>boot2docker ssh
Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker version 1.5.0, build a8a31ef
docker#boot2docker:~$ ls
boot2docker, please format-me
docker#boot2docker:~$ mkdir testdir
docker#boot2docker:~$ ls
boot2docker, please format-me testdir/
docker#boot2docker:~$ exit
C:\Users\Tom>boot2docker stop
error in run: Failed to stop machine "boot2docker-vm": exit status 1
C:\Users\Tom>boot2docker status
poweroff
C:\Users\Tom>boot2docker start
Waiting for VM and Docker daemon to start...
....................ooo
Started.
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\Tom\.boot2docker\certs\boot2docker-vm\key.pem
Docker client does not run on Windows for now. Please use
"boot2docker" ssh
to SSH into the VM instead.
C:\Users\Tom>boot2docker ssh
Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker version 1.5.0, build a8a31ef
docker#boot2docker:~$ ls
boot2docker, please format-me
docker#boot2docker:~$
Running
Windows: 8.1
VirtualBox: 4.3.12 r93733
Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker version 1.5.0, build a8a31ef
That is what I explained in "Windows Boot2Docker behind corporate proxy": there is no persistence in the Tiny Core used by boot2docker as a Linux VM.
You need to make sure the VirtualBox has the Oracle_VM_VirtualBox_Extension_Pack downloaded and added in the Virtual Box / File / Settings / Extension / add the Oracle_VM_VirtualBox_Extension_Pack-4.x.yy-zzzzz.vbox-extpack file).
As documented in boot2docker, you will have access (from your Tiny Core ssh session) to /c/Users/<yourLogin> (ie the %USERPROFILE% is shared by Virtual Box)
What I do in my b2d.bat start script is copy the files I want to be restored (mainly docker profile or .ashrc, for http_proxy settings and favorite aliases), and keep all my other modifications in /c/Users/<yourLogin>.
I am on ubuntu 14.04 and I also upgrade docker to recent version.
Whenever I do a sudo /etc/init.d/docker start I get a successful pid as follows,
docker start/running, process 16267
When I view the PID details, I see nothing -
ps -p 16267
PID TTY TIME CMD
And when I try to do a sudo docker version I see the below -
Client API version: 1.16
Go version (client): go1.2.1
OS/Arch (client): linux/amd64
2015/01/10 10:30:49 Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
The output of sudo docker -d is as follows,
[2015-01-12T21:05:59.889680188+08:00] [info] docker daemon: ; execdriver: native; graphdriver:
[2015-01-12T21:05:59.889800519+08:00] [83736c52] +job serveapi(unix:///var/run/docker.sock)
[2015-01-12T21:05:59.895688816+08:00] [info] Listening for HTTP on unix (/var/run/docker.sock)
[2015-01-12T21:05:59.904409095+08:00] [83736c52] +job init_networkdriver()
[2015-01-12T21:05:59.932947471+08:00] [83736c52] -job init_networkdriver() = OK (0)
[2015-01-12T21:05:59.933137366+08:00] [fatal] log.go:64 Could not locate dockerinit: This usually means docker was built incorrectly. See http://docs.docker.com/contributing/devenvironment for official build instructions.
I am not sure what is going wrong. Has anyone overcome similar issues? I am not even sure when I should check for more logs on this. Any directions on this will be helpful.
Thanks
You probably have a corrupted install.
Uninstall docker
Make sure you don't have a dockerinit (updatedb / locate dockerinit) -> delete it
Reinstall docker
This should do the trick.
If not, try uninstalling docker again and try with binaries from https://docs.docker.com/installation/binaries/.