1.复制文件
通过yum安装相同版本的docker。将 /usr/share/bash-completion/completions/docker 文件拷贝到二进制安装的docker服务器上的 /usr/share/bash-completion/completions/ 目录下
2.安装bash-completion
yum install -y bash-completion
3.刷新生效
source /usr/share/bash-completion/completions/docker
source /usr/share/bash-completion/bash_completion
4.测试生效
[root@localhost ~]# docker
attach context exec import logout port rm service system version
build cp export info logs ps rmi stack tag volume
builder create help inspect network pull run start top wait
commit diff history kill node push save stats trust
config engine image load pause rename search stop unpause
container events images login plugin restart secret swarm update
[root@localhost ~]#