Docker

安装

  • Ubuntu 版本信息

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

getconf LONG_BIT
64

uname -a
Linux u-develop 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linu

  • 卸载旧版本
     sudo apt-get remove docker docker-engine docker.io containerd runc
    
  • 更新仓库信息
    sudo apt-get update
    
    允许使用HTTPS
     sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg-agent \
     software-properties-common
    
  • 添加GPG Key
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

验证Key的指纹

sudo apt-key fingerprint 0EBFCD88

pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) docker@docker.com
sub rsa4096 2017-02-22 [S]

*添加稳定版本Repository

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
  • 安装最新版本的docker ce和containerd
sudo apt-get install docker-ce docker-ce-cli containerd.io
  • 验证DOCKER
sudo docker run hello-world

如果本地没有这个镜像,会从远程仓库中下载下来。

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容