2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Dockerインストール

Last updated at Posted at 2020-12-31

Dockerインストール

実行環境

Inked68747470733a2f2f71696974612d696d6167652d73746f72652e73332e61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f302f3131323439342f63613334653666302d363638372d396436652d323736372d6166393530646530353633332e706e6_LI.jpg

インストール

% 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をダウンロードしてみる。とりあえずインストール。
スクリーンショット 2020-12-31 9.31.53.png
スクリーンショット 2020-12-31 9.38.23.png

無事起動
なんだったんだ

【追記】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
  1. Casksのdockerを brew install --casks docker
  2. Docker Desktopを起動

まとめ

  • 素直に公式サイトでDocker Desktopをインストールしたほうが良い
  • Homebrewで管理したかったがために、時間がかかった。。。公式サイトには書いてないよ(;_;)
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?