Docker

来自qingwei personal wiki
Yuanliu2讨论 | 贡献2018年1月15日 (一) 07:20的版本 (创建页面,内容为“== Install == install : yum install docker sudo systemctl start docker sudo systemctl enable docker -------make sure it starts at every server reboot: 透过proxy…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

Install

install : yum install docker

sudo systemctl start docker

sudo systemctl enable docker -------make sure it starts at every server reboot:

透过proxy进行docker pull [root@localhost sereno_106]# cat /etc/sysconfig/docker

http_proxy=http://proxy-wsa.esl.cisco.com:80/
https_proxy=http://proxy-wsa.esl.cisco.com:80/
HTTP_PROXY=http://proxy-wsa.esl.cisco.com:80/
HTTPS_PROXY=http://proxy-wsa.esl.cisco.com:80/
NO_PROXY=dockerhub.cisco.com,sdntools.cisco.com
no_proxy=dockerhub.cisco.com,sdntools.cisco.com
export http_proxy https_proxy no_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY

service docker restart docker info

2. 將非 root 帳號加上 docker 群組中 將要使用 docker client 的帳號加到 docker 群組中~ 像下面的指令會將 testuser 這個帳號加到 docker 群組裡: sudo usermod -G docker -a testuser


加入群組後,假設這個帳號就是登入中的帳號的話, group 的資訊並不會立刻更新: testuser@localhost ~ $ groups testuser wheel


為了要能立刻產生作用,執行 newgrp docker, 讓這個帳號立刻改成使用 docker 這個群組 (或是你要登出登入也行): testuser@localhost ~ $ newgrp docker testuser@localhost ~ $ groups docker wheel testuser


3. 重新啟動 docker 服務 重啟 docker 服務之後,所有的變動就完成了: sudo systemctl restart docker