ubuntu16.10安裝docker17.03.0-ce并配置國(guó)內(nèi)源和加速器
說(shuō)明:這個(gè)針對(duì)docker-ce安裝,ce和ee的區(qū)別是前者是社區(qū)版,后者是企業(yè)版
1. 配置Ubuntu的源,不然慢的去哭吧。參考https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ 注意版本要對(duì)應(yīng)。我的源配置見(jiàn)附件http://xiazai.jb51.net/201705/yuanma/sources_jb51.rar。
2. 安裝docker,按照官方教程https://docs.docker.com/engine/installation/linux/ubuntu/
環(huán)境依賴
$ sudo apt-get update $ sudo apt-get install \ linux-image-extra-$(uname -r) \ linux-image-extra-virtual
安裝docker包
$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
添加docker官方GPG秘鑰
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
安裝穩(wěn)定版?zhèn)}庫(kù)
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
再次更新源
sudo apt-get update
安裝docker-ce
sudo apt-get install docker-ce
3. 給docker添加國(guó)內(nèi)加速器(參考https://github.com/yeasy/docker_practice/blob/master/install/mirror.md)
在阿里云申請(qǐng)一個(gè)賬號(hào),打開(kāi)連接https://cr.console.aliyun.com/#/accelerator 拷貝您的專屬加速器地址,然后/etc/systemd/system/multi-user.target.wants/docker.service 文件,找到 ExecStart= 這一行,在這行最后添加加速器地址 --registry-mirror=<加速器地址>
如:ExecStart=/usr/bin/dockerd --registry-mirror=https://jxus37ad.mirror.aliyuncs.com
注:對(duì)于 1.12 以前的版本,dockerd 換成 docker daemon
重新加載配置并且重新啟動(dòng)
$ sudo systemctl daemon-reload $ sudo systemctl restart docker
至此docker安裝及國(guó)內(nèi)加速器都好了,開(kāi)始你的docker之旅吧。
hello-word
$ sudo docker run hello-world
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持本站。
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信