Docker CE瀹夎

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Docker CE瀹夎相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/art' title='art'>art   mirror   com   dev   ons   --   logrotate   str   

瀹樻柟鏂囨。锛?a href="https://docs.docker.com/install/linux/docker-ce/centos/">https://docs.docker.com/install/linux/docker-ce/centos/

鍗歌浇鏃х増鏈?/h3>

$ sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-engine

yum瀹夎锛堟帹鑽愪娇鐢▂um 瀹夎锛屾柟渚垮畨瑁呭拰鍗囩骇锛?/h3>
  • 璁剧疆yum浠撳簱

瀹夎鎵€闇€鐨勫寘銆倅um-utils鎻愪緵浜唝um-config-manager 鏁堢敤锛屽苟device-mapper-persistent-data鍜宭vm2鐢遍渶瑕?nbsp;devicemapper瀛樺偍椹卞姩绋嬪簭

$ sudo yum install -y yum-utils
device-mapper-persistent-data
lvm2

  • 浣跨敤涓嬪垪鍛戒护浣跨敤绋冲畾瀛樺偍搴?/li>

$ sudo yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo

鍒拌繖閲岋紝docker yum浠撳簱閰嶇疆瀹屾垚锛屼笅涓€姝ヨ繘琛屽畨瑁?/p>

瀹夎

  • 瀹夎鏈€鏂扮増

$ sudo yum install docker-ce docker-ce-cli containerd.io

  • 瀹夎绋冲畾鐗堬紙涓轰簡绋冲畾鎬ч渶姹傦紝鐢熶骇鎴戜滑涓€鑸細瀹夎杈冧负绋冲畾鐨勪笉閭d箞鏂扮殑鐗堟湰锛?/li>
  • 鐗堟湰鏌ョ湅鍛戒护锛?/li>

$ yum list docker-ce --showduplicates | sort -r

docker-ce.x86_64            3:19.03.2-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.1-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.0-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.9-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.8-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.7-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.6-3.el7                     docker-ce-stable
  • 瀹夎鍛戒护锛?/li>

$ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

$sudo yum install docker-ce-18.06.3.ce-3.el7 docker-ce-cli-18.06.3.ce-3.el7 containerd.io

鍒版锛屽畨瑁呭畬鎴?

鍚姩docker

$ sudo systemctl start docker

楠岃瘉

$ sudo docker run hello-world

閰嶇疆闀滃儚鍔犻€?/h3>

鐢变簬 Docker Hub 鐨勬湇鍔″櫒鍦ㄥ浗澶栵紝涓嬭浇闀滃儚浼氭瘮杈冩參銆傚垢濂?DaoCloud 涓烘垜浠彁渚涗簡鍏嶈垂鐨勫浗鍐呴暅鍍忔湇鍔°€?/p>

涓嬮潰浠嬬粛濡傛灉浣跨敤闀滃儚銆?/p>

https://www.daocloud.io/mirror

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

閲嶅惎docker deamon锛屽嵆鍙綋楠岄涓€鑸殑鎰熻

#systemctl restart docker.service

閰嶇疆docker 鍛戒护鑷姩琛ュ叏

瀹夎docker鑷甫鍖咃細

source /usr/share/bash-completion/completions/docker

缂哄皯涓嬮潰鐨勫寘锛孴AB浼氭姤閿?/p>

yum install -y bash-completion

chmod 755  /usr/share/bash-completion/bash_completion

sh /usr/share/bash-completion/bash_completion

瀹夎瀹屾垚閲嶆柊鍚姩shell缁堢娴嬭瘯銆?/p>

閬囧埌鐨勯棶棰樺鐞?/h3>

centos瀹夎7瀹夎docker-ce-18.06.3.ce-3.el7 鍚庯紝docker鍚姩澶辫触锛岀綉涓婄殑鍔炴硶锛堥兘鏄叧浜巇aemon.json鏂囦欢淇敼锛夋病鏈夊鏁堬紝鍚庢墽琛寉um update -y鍗囩骇鍒?19.03.2锛岄棶棰樿В鍐炽€?/p>

以上是关于Docker CE瀹夎的主要内容,如果未能解决你的问题,请参考以下文章

docker 瀹夎prometheus鍜実rafna

[FAQ] docker-ce depends on containerd.io, docker-ce depends on docker-ce-cli

yum安装docker-18.01-ce

docker 002 安装docker-ce

Docker EE/Docker CE简介与版本规划

centos7安装docker-ce