Docker

出自 qingwei personal wiki
於 2018年1月15日 (一) 07:20 由 Yuanliu2 (對話 | 貢獻) 所做的修訂 (创建页面,内容为“== 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