日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

Ubuntu16.04安装docker

發(fā)布時間:2023/12/15 Ubuntu 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu16.04安装docker 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

官網(wǎng):

  • https://docs.docker.com/get-started/

  • https://hub.docker.com/

  • https://docs.docker.com/install/linux/docker-ce/ubuntu/

?

一、安裝

1.?更新

sudo apt-get update

?

2.?安裝依賴包?

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

?

3. 添加官方密鑰

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

?

4. 添加倉庫

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu?$(lsb_release -cs) stable"

?

5. 再次更新

sudo apt-get update

?

6. 安裝docker

sudo apt-get install -y docker-ce

?

?

二、測試

1.? 查看docker服務(wù)是否啟動:systemctl status docker

baoli@ubuntu:~$ systemctl status docker ● docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Active: active (running) since Sun 2019-09-08 15:19:27 CST; 44s agoDocs: https://docs.docker.com Main PID: 11480 (dockerd)Tasks: 10Memory: 55.4MCPU: 893msCGroup: /system.slice/docker.service└─11480 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock Sep 08 15:19:26 ubuntu dockerd[11480]: time="2019-09-08T15:19:26.795250717+08:00" level=wa Sep 08 15:19:26 ubuntu dockerd[11480]: time="2019-09-08T15:19:26.795341137+08:00" level=wa Sep 08 15:19:26 ubuntu dockerd[11480]: time="2019-09-08T15:19:26.795349613+08:00" level=wa Sep 08 15:19:26 ubuntu dockerd[11480]: time="2019-09-08T15:19:26.796868238+08:00" level=in Sep 08 15:19:27 ubuntu dockerd[11480]: time="2019-09-08T15:19:27.218386729+08:00" level=in Sep 08 15:19:27 ubuntu dockerd[11480]: time="2019-09-08T15:19:27.438357184+08:00" level=in Sep 08 15:19:27 ubuntu dockerd[11480]: time="2019-09-08T15:19:27.747766312+08:00" level=in Sep 08 15:19:27 ubuntu dockerd[11480]: time="2019-09-08T15:19:27.749026100+08:00" level=in Sep 08 15:19:27 ubuntu systemd[1]: Started Docker Application Container Engine. Sep 08 15:19:27 ubuntu dockerd[11480]: time="2019-09-08T15:19:27.818603590+08:00" level=in lines 1-21/21 (END)

若未啟動,則啟動docker: sudo systemctl start docker

?

2.? 運行hello-world

執(zhí)行:sudo docker run hello-world,提示:

baoli@ubuntu:~$ sudo docker run hello-world Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). See 'docker run --help'.

解決:

鑒于國內(nèi)網(wǎng)絡(luò)問題,后續(xù)拉取 Docker 鏡像十分緩慢,我們可以需要配置加速器來解決,我使用的是網(wǎng)易的鏡像地址:http://hub-mirror.c.163.com。

1)sudo vim??/etc/docker/daemon.json

2)添加

{ "registry-mirrors": ["http://hub-mirror.c.163.com"] }

3)sudo service docker restart

再次執(zhí)行:sudo docker run hello-world

baoli@ubuntu:~$ sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:451ce787d12369c5df2a32c85e5a03d52cbcef6eb3586dd03075f3034f10adcd Status: Downloaded newer image for hello-world:latestHello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64) 3. The Docker daemon created a new container from that image which runs theexecutable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/

?

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎

總結(jié)

以上是生活随笔為你收集整理的Ubuntu16.04安装docker的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。