1
0

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 for Mac 設定

Posted at

Macの環境

  • 機種:MacBook Air(M1,2020)
  • CPU:Apple M1
  • Memory:16Gb
  • OS:macOS Big Sur
  • SHELL:zsh
  • docker:20.10.8

CUI tab補完

docker公式のコマンドライン補完の設定はcurlのリンクが死んでいて利用できなかった。そのため、dockerをインストールした際に存在している補完ソースを利用した。今回は、自身の環境で成功した、zshについて書く。

zsh-completionsの確認

zsh-completionsを使うため、インストールされているか確認する。

$ brew list | grep zsh-completions
# 存在していなければ、下記を実行
$ brew install zsh-completions

補完ソースのシンボリックリンクを作成

# ~/.zsh/completionsの階層がなければ、下記を実行
$ mkdir -p ~/.zsh/completions
# 補完ソースの保存場所作成
$ touch _docker
$ touch _docker-compose
$ ln -s /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion ~/.zsh/completions/_docker
$ ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.zsh-completion ~/.zsh/completions/_docker-compose

zsh-completionsの有効化

.zshrc
# 下記の追記
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i

zshの再起動

$ source ~/.zshrc
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?