K8S|Ubuntu18.04安装docker-ce最新版


Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器或Windows机器上,也可以实现虚拟化,容器是完全使用沙箱机制,相互之间不会有任何接口。
一个完整的Docker有以下几个部分组成:
Docker Client客户端
Docker Daemon守护进程
Docker Image镜像
Docker Container容器

以上是官方知识,我理解Docker是提供一套打包的基础环境,让容器可以自由的运行.容器就类似纸杯吧:里面可以装果汁,也可以装水,最关键的可以用完就换一个.
具体的原理太枯燥了,我也都不想复习.还是先把运行环境弄起来吧.因为Mac和Windows都有一键安装包,也没什么复杂的,直接下一步下一步就ok了.我们主要聊Linux,而Linux发行版众多,以笔者熟悉的Ubuntu为例.

  • 确定系统版本
lsb_release -a    
LSB Version:    core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic
  • 安装apt相关的工具包
apt update
apt install apt-transport-https ca-certificates curl software-properties-common
  • 导入Docker官方证书
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
  • 查看官方可安装版本
apt update
apt-cache policy docker-ce
docker-ce:
  Installed: (none)
  Candidate: 5:19.03.6~3-0~ubuntu-bionic
  Version table:
     5:19.03.6~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.5~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.4~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.3~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
  • 安装最新版
apt install docker-ce
  • 查看Docker版本
docker version
Client: Docker Engine - Community
 Version:           19.03.6
 API version:       1.40
 Go version:        go1.12.16
 Git commit:        369ce74a3c
 Built:             Thu Feb 13 01:27:49 2020
 OS/Arch:           linux/amd64
 Experimental:      false
Server: Docker Engine - Community
 Engine:
  Version:          19.03.6
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.16
  Git commit:       369ce74a3c
  Built:            Thu Feb 13 01:26:21 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

至此就可以愉快的玩耍了.


相关博文

About rainbird

IOS攻城狮
This entry was posted in K8S and tagged , , , , , , . Bookmark the permalink.

发表评论