Docker

来自qingwei personal wiki
Qingwei讨论 | 贡献2018年6月15日 (五) 02:54的版本
跳转至: 导航搜索

常用命令

image保存导入

docker save -o my_ubuntu_v3.tar runoob/ubuntu:v3
docker load<wiki.tar

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