Kubernetes(一):Ubuntu上安裝Docker

前言

參考Docker官方文檔在阿里云ECS實(shí)例上安裝Docker。
官方文檔:https://docs.docker.com/install/linux/docker-ce/ubuntu/

安裝要求

Docker CE要求的Ubuntu版本:

  • Disco 19.04
  • Cosmic 18.10
  • Bionic 18.04 (LTS)
  • Xenial 16.04 (LTS)
# 查看系統(tǒng)版本
$ cat /proc/version
Linux version 4.4.0-142-generic (buildd@lgw01-amd64-033) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) ) #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019
# 查看發(fā)行版名稱
$ lsb_release -cs
xenial

卸載舊版本(略)

$ sudo apt-get remove docker docker-engine docker.io containerd runc

準(zhǔn)備工作

# 更新源
$ sudo apt-get update
# 安裝必要的工具,如HTTPS工具、GPG工具等
$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
# 添加docker的gpg秘鑰到apt-key密鑰中,用于確認(rèn)所下載的軟件包的合法性
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 添加docker源
# 可以使用aliyun的內(nèi)網(wǎng)鏡像代替:http://mirrors.cloud.aliyuncs.com/docker-ce/linux/ubuntu
$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

安裝

# 更新源
$ sudo apt-get update
# 安裝
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

驗(yàn)證

$ docker version
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:9572f7cdcee8591948c2963463447a53466950b3fc15a247fcad1917ca215a2f
Status: Downloaded newer image for hello-world:latest

Hello 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 the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to 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/

至此docker已正確安裝

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Docker 是一個(gè)開源項(xiàng)目,誕生于 2013 年初,最初是 dotCloud 公司內(nèi)部的一個(gè)業(yè)余項(xiàng)目。它基于 G...
    涼初透的風(fēng)閱讀 7,783評論 0 3
  • 前言 接著上回,要部署NextCloud服務(wù),那么如何安裝這個(gè)服務(wù)呢?在Ubuntu 18.04下,根據(jù)官方文檔,...
    氧化鈣CCCCaO閱讀 3,209評論 0 3
  • 英文原版地址https://docs.docker.com/install/linux/docker-ce/ubu...
    cschen閱讀 1,219評論 1 0
  • 今天一早看著那么多堆放在那的東西,終于忍不住,仍掉了一部分??粗@這些東西想扔的時(shí)候就給自己說后面可能還有用,就放...
    xue海洋閱讀 249評論 2 1
  • 一位身材臃腫、穿著老土的大媽,參加《英國達(dá)人秀》節(jié)目,這是她第一次登臺(tái)演出。 評委問她夢想是什么,大媽結(jié)結(jié)巴巴地回...
    遇見為了預(yù)見閱讀 1,024評論 0 2

友情鏈接更多精彩內(nèi)容