“Docker”的版本间的差异
来自qingwei personal wiki
(创建页面,内容为“== Install == install : yum install docker sudo systemctl start docker sudo systemctl enable docker -------make sure it starts at every server reboot: 透过proxy…”) |
|||
第1行: | 第1行: | ||
+ | == 常用命令 == | ||
+ | === image保存导入 === | ||
+ | <source lang="shell"> | ||
+ | docker save -o my_ubuntu_v3.tar runoob/ubuntu:v3 | ||
+ | docker load<wiki.tar | ||
+ | </source> | ||
+ | |||
== Install == | == Install == | ||
install : | install : |
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