Brew install docker does not include docker engine? - macos

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

Related

How can run Docker in linux 20.04 in Windows 11

Hi, I have this problem, trying to running Docker in Ubuntu 20.04 in windows 11 using the WSL, I installed it using the official documentation in https://docs.docker.com/engine/install/linux-postinstall/, I tried with some commands like:
sudo service docker start | restart
Show me OK but this didn't work when I tried to execute again the run hello-world command.
Can you help me please?
You should install Docker for Windows and manage it from there, rather than a service within WSL. Then in the preferences, you can link it to WSL2, where it'll install the Docker CLI.

issue while installing docker for Mac using command line?

I want to install docker using command line not using docker for mac. I have downloaded the individual binary for Mac from this link.
docker ce binaries
I am able to run docker command but if I run docker ps then it shows
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
I tried another way to downloading docker using brew as below
brew cask install docker
But using brew it only download the desktop setup of docker and I have to start it manually.
So I am looking for a solution in which I can install and run docker through command without involving any UI.
Thanks
The error above means that the docker service is not running so you have to run it first. Then enable it to start on boot - to avoid the need to start it each time you login to your macOS - at the end you should be able to use docker cli without issues

Kitematic Fail after clean setup

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.

Docker daemon does not start or restart

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/.

Installing docker with devstack

I am trying to install devstack and docker (http://devstack.org/guides/single-machine.html) onto a VM containing Ubuntu 13.10 Server. devstack contains a docker installer script in tools/docker/install_docker.sh which it is recommended to run first before running the stack.sh installer script for devstack. I have patched the docker install script according to the bug report https://bugs.launchpad.net/devstack/+bug/1237581 however docker still reports a problem:
socat[NNNN] E connect(3, AF=1 "/var/run/docker.sock", 22): Connection refused
Does anyone know a fix for this problem?
Thanks,
David
If you get error messages regarding /var/run/docker.sock then either the docker daemon/service is not started or your user (devstack user) has no permissions.
Start docker:
service docker restart
Add your user (devstack user) to the docker group. Try to enumerate containers:
docker ps
If that still does not fix the problem then you might want to change the permission of /var/run/docker.sock directly:
sudo chown vagrant:vagrant /var/run/docker.sock
Check your kernel ( uname -a ) and make sure it is 3.8 or latest. Also, make sure you are on a 64bit Ubuntu ( X86_64 distribution ). The point is that the Docker daemon might not be starting (fails) because it is not supported on a 32 bit distribution.

Resources