macにxcodeとbrewとdocker をインストールしてみた。

# xcodeのインストール
- xcodeをインストールしてみる。
    - 検索ワード：vscode for mac
        - qiitaのいろいろなページが出てくる。
    - おすすめは、microsoftの公式ページが出てくるサイトである。
    - microsoftのページが出てきたら、Download for macからダウンロードする。
    - ダウンロードしたら、appフォルダに入れる。そして、Dockにショートカットを作成する。
        - zipでダウンロードされるので、解凍して、アプリケーションを自分のアプリケーションフォルダを開いて、そこにドラックアンドドロップしてコピーする。
- xcodeのアプリケーションのインストール
    - 自分で追加したいアプリケーションがあった場合には、vscodeのextensionからインストールする。
        - extentionは、4つの箱のうち右上が離れているやつをクリックすれば良い。
        - 検索窓が出てくるので、そこに入れたいモジュールなどのキーワードを入れればよい。

# brewのインストール
- brewをインストールしてみる。
    - dockerをinstallしようと思ったが、brewをinstallしてからやるとCLIで完結しそうだったので、brewをインストールして、やってみる。
        - 検索ワード：brew install for mac
    - homebrewの公式ページが出てくると思うので、mac用のコマンドを叩いてインストールする。
    - 
   ```
dev@devPC vscode % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```
コンソールログ。

```
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/bin
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
Password:
==> /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/sbin/chown dev /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /Users/dev/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/dev/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown dev /Users/dev/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools for Xcode-11.3
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ for\ Xcode-11.3
Software Update Tool


Downloading Command Line Tools for Xcode
Downloaded Command Line Tools for Xcode
Installing Command Line Tools for Xcode
Done with Command Line Tools for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Enumerating objects: 57, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 132474 (delta 30), reused 15 (delta 6), pack-reused 132417
Receiving objects: 100% (132474/132474), 31.88 MiB | 11.29 MiB/s, done.
Resolving deltas: 100% (97224/97224), done.
From https://github.com/Homebrew/brew
 * [new branch]      dependabot/bundler/docs/unicode-display_width-1.7.0 -> origin/dependabot/bundler/docs/unicode-display_width-1.7.0
 * [new branch]      master                                              -> origin/master
 * [new tag]         0.1                                                 -> 0.1
 * [new tag]         0.2                                                 -> 0.2
【中略<img width="1332" alt="docker.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/412423/6ac04f2f-3b88-241f-7978-cdaee2aa99f8.png">
<img width="1332" alt="docker.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/412423/da5d6444-ecd8-9dfb-9715-d3beb11b0f5d.png">
】
 * [new tag]         2.2.9                                               -> 2.2.9
HEAD is now at ee69c5aec Merge pull request #7157 from MikeMcQuaid/an-commit
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 860, done.
remote: Counting objects: 100% (860/860), done.
remote: Compressing objects: 100% (531/531), done.
remote: Total 692425 (delta 570), reused 610 (delta 329), pack-reused 691565
Receiving objects: 100% (692425/692425), 277.12 MiB | 19.30 MiB/s, done.
Resolving deltas: 100% (454653/454653), done.
Checking out files: 100% (5164/5164), done.
Tapped 2 commands and 4927 formulae (5,188 files, 304.2MB).
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
dev@devPC vscode %
```

これでインストール完了。

```
dev@devPC vscode % brew
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh
dev@devPC vscode % 
```
brewのコマンドが出てきたら、OK。とする。
brewの詳細については、後ほど書けたらいいなと思います。


# docker engineのインストール
- mac にdocker engineをインストールしてみる。
    - brewコマンドがインストールできたら、docker をインストールする。
        - 検索ワード：docker install brew
        - たくさんのqiitaのページが出てくるので、それを参考にする。
   

```
dev@devPC vscode % brew install docker
==> Downloading https://homebrew.bintray.com/bottles/docker-19.03.7.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/49/49d5d956190c7b7218643f0cd9ddac9afc488c780e4e994be50a5168126e8764?__gda__=exp=1583940099~hmac=9997d78a34
######################################################################## 100.0%
==> Pouring docker-19.03.7.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/docker/19.03.7: 14 files, 74.7MB
```

私は上記のコマンドでインストールしてみた。

```
dev@devPC vscode % docker ps 
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

```

docker ps しても、daemonが起動してないみたい。
下記コマンドで起動する。

```
dev@devPC vscode % brew cask install docker
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 419003 (delta 0), reused 2 (delta 0), pack-reused 418999
Receiving objects: 100% (419003/419003), 190.21 MiB | 20.19 MiB/s, done.
Resolving deltas: 100% (296114/296114), done.
Tapped 1 command and 3494 casks (3,610 files, 204MB).
==> Downloading https://download.docker.com/mac/stable/42716/Docker.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'docker'.
==> Installing Cask docker
==> Moving App 'Docker.app' to '/Applications/Docker.app'.
🍺  docker was successfully installed!
dev@devPC vscode % docker ps 
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
dev@devPC vscode % open /Applications/Docker.app

dev@devPC vscode % 
```


パスワードなどを入れると起動する。

終わり