Dockerインストール
実行環境
インストール
% brew install docker
確認
% docker -v
% Docker version 19.03.14, build 5eb3275
これで行けるかと思ったら。。
% docker-compose up
% zsh: command not found: docker-compose
docker-composeをインストールしないとだめみたい。。
curlでインストールして、権限を付与する。
% sudo curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
% sudo chmod +x /usr/local/bin/docker-compose
確認
% docker-compose -v
docker-compose version 1.27.4, build 40524192
無事インストールされたはず。。。
確認
% docker-compose up
Traceback (most recent call last):
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1252, in request
File "http/client.py", line 1298, in _send_request
File "http/client.py", line 1247, in endheaders
File "http/client.py", line 1026, in _send_output
File "http/client.py", line 966, in send
File "site-packages/docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/requests/adapters.py", line 449, in send
File "site-packages/urllib3/connectionpool.py", line 727, in urlopen
File "site-packages/urllib3/util/retry.py", line 403, in increment
File "site-packages/urllib3/packages/six.py", line 734, in reraise
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1252, in request
File "http/client.py", line 1298, in _send_request
File "http/client.py", line 1247, in endheaders
File "http/client.py", line 1026, in _send_output
File "http/client.py", line 966, in send
File "site-packages/docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version
File "site-packages/docker/api/daemon.py", line 181, in version
File "site-packages/docker/utils/decorators.py", line 46, in inner
File "site-packages/docker/api/client.py", line 228, in _get
File "site-packages/requests/sessions.py", line 543, in get
File "site-packages/requests/sessions.py", line 530, in request
File "site-packages/requests/sessions.py", line 643, in send
File "site-packages/requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 67, in main
File "compose/cli/main.py", line 123, in perform_command
File "compose/cli/command.py", line 69, in project_from_options
File "compose/cli/command.py", line 132, in get_project
File "compose/cli/docker_client.py", line 43, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "site-packages/docker/api/client.py", line 188, in __init__
File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[31319] Failed to execute script docker-compose
たくさんのエラー。。
公式ページからDockerをダウンロードしてみる。とりあえずインストール。
無事起動
なんだったんだ
【追記】Homebrew Casksをインストールしてなかったのが原因
% brew search docker
==> Casks
alfred appcleaner clipy dropbox font-hackgen font-hackgen-nerd google-chrome google-drive google-japanese-ime iterm2 visual-studio-code
satoru@Mac-mini Curriculum-vitae % brew search docker
==> Formulae
docker ✔ docker-compose docker-credential-helper-ecr docker-machine docker-machine-driver-vmware docker-machine-nfs docker-squash dockerize
docker-clean docker-compose-completion docker-gen docker-machine-completion docker-machine-driver-vultr docker-machine-parallels docker-swarm lazydocker
docker-completion docker-credential-helper docker-ls docker-machine-driver-hyperkit docker-machine-driver-xhyve docker-slim docker2aci
==> Casks
docker docker-toolbox
- Casksのdockerを
brew install --casks docker
- Docker Desktopを起動
まとめ
- 素直に公式サイトでDocker Desktopをインストールしたほうが良い
- Homebrewで管理したかったがために、時間がかかった。。。公式サイトには書いてないよ(;_;)