新聞中心
Docker容器作為一個(gè)全新的概念雖然廣受關(guān)注,但是對(duì)于如何使用Docker,將容器技術(shù)真正落地用起來(lái),目前估計(jì)很多人還沒(méi)有非常清晰的思路,本篇文章重點(diǎn)為大家講解一下Linux系統(tǒng)中安裝Docker容器具體方法。

站在用戶的角度思考問(wèn)題,與客戶深入溝通,找到冊(cè)亨網(wǎng)站設(shè)計(jì)與冊(cè)亨網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類(lèi)型包括:網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、虛擬主機(jī)、企業(yè)郵箱。業(yè)務(wù)覆蓋冊(cè)亨地區(qū)。
1.CentOS
服務(wù)器的系統(tǒng)是CentOS7.4的
[root@VM_82_178_centos ~]# cat /etc/RedHat-release
CentOS Linux release 7.4.1708 (Core)
#安裝依賴包
yum install -y yum-utils device-mapper-persistent-data lvm2
#添加Docker軟件包源
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
#安裝Docker CE
yum install docker-ce -y
#啟動(dòng)
systemctl start docker
#開(kāi)機(jī)啟動(dòng)
systemctl enable docker
#查看Docker信息
docker info
2.Ubuntu 上安裝
apt-get update
安裝證書(shū):
apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
添加docker源的key:
sudo apt-key fingerprint 0EBFCD88
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb)
sub 4096R/F273FCD8 2017-02-22
添加docker軟件包源:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
跟新apt包索引:
sudo apt-get update
安裝docker ce
apt-get install docker-ce
3.配置Docker加速器
Docker Hub 提供眾多鏡像,你可以從中自由下載數(shù)十萬(wàn)計(jì)的免費(fèi)應(yīng)用鏡像, 這些鏡像作為 docker 生態(tài)圈的基石,是我們使用和學(xué)習(xí) docker 不可或缺的資源。為了解決國(guó)內(nèi)用戶使用 Docker Hub 時(shí)遇到的穩(wěn)定性及速度問(wèn)題 DaoCloud 推出永久免費(fèi)的新一代加速器服務(wù)。 Linux:
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://bc437cce.m.daocloud.io
[root@localhost ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://bc437cce.m.daocloud.io
docker version >= 1.12
{"registry-mirrors": ["http://bc437cce.m.daocloud.io"]}
Success.
You need to restart docker to take effect: sudo systemctl restart docker
[root@localhost ~]#
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# systemctl stop docker
[root@localhost ~]# ps -ef|grep docker
root 15185 3300 0 01:39 pts/1 00:00:00 grep --color=auto docker
[root@localhost ~]# systemctl start docker
[root@localhost ~]# ps -ef|grep docker
root 15191 1 2 01:39 ? 00:00:00 /usr/bin/dockerd
root 15198 15191 0 01:39 ? 00:00:00 docker-containerd --config /var/run/docker/containerd/containerd.toml
root 15325 3300 0 01:39 pts/1 00:00:00 grep --color=auto docker
[root@localhost ~]#
網(wǎng)頁(yè)題目:Linux系統(tǒng)中安裝Docker容器具體方法
文章出自:http://www.dlmjj.cn/article/djdhgpe.html


咨詢
建站咨詢
