首页 > 系统相关 >ubuntu 20.4安装docker

ubuntu 20.4安装docker

时间:2022-12-29 20:00:35浏览次数:43  
标签:20.4 version aliyun ubuntu http docker com

ubuntu 20.4 安装docker

目录

  • 查看版本并升级套件
  • 安装必要软件
  • 添加阿里云的GPG密钥,命令设置存储库
  • 执行安装,查看版本

查看版本并升级套件

cat /proc/version

Linux version 5.4.0-135-generic (buildd@lcy02-amd64-066) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC

apt-get update

Hit:1 http://mirrors.aliyun.com/ubuntu focal InRelease                        
Get:2 http://mirrors.aliyun.com/ubuntu focal-updates InRelease [114 kB]                       
Get:3 http://mirrors.aliyun.com/ubuntu focal-backports InRelease [108 kB]                     
Get:4 http://mirrors.aliyun.com/ubuntu focal-security InRelease [114 kB]                    
Get:5 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease [3,956 B]                                                  
Get:6 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main amd64 Packages [418 B] 

安装必要软件

apt-get install ca-certificates curl gnupg lsb-release

Reading package lists... Done
Building dependency tree       
Reading state information... Done
lsb-release is already the newest version (11.1.0ubuntu2).
lsb-release set to manually installed.
ca-certificates is already the newest version (20211016ubuntu0.20.04.1).
ca-certificates set to manually installed.
curl is already the newest version (7.68.0-1ubuntu2.14).
curl set to manually installed.
gnupg is already the newest version (2.2.19-3ubuntu2.2).
gnupg set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 34 not upgraded.

添加阿里云的GPG密钥,命令设置存储库

mkdir -p /etc/apt/keyrings curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

Hit:1 http://mirrors.aliyun.com/ubuntu focal InRelease                                                            
Hit:2 http://mirrors.aliyun.com/ubuntu focal-updates InRelease                                                    
Hit:3 http://mirrors.aliyun.com/ubuntu focal-backports InRelease                                                                                  
Hit:4 http://mirrors.aliyun.com/ubuntu focal-security InRelease                                                                                   
Hit:5 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease                                                      
Get:6 http://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease [57.7 kB]                  
Get:7 http://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages [22.3 kB]
Get:8 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]                                                                                
Get:9 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [22.3 kB]                                                                    
Fetched 160 kB in 21s (7,518 B/s)                                                                                                                       
Reading package lists... Done

执行安装,查看版本

apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y docker version

Client: Docker Engine - Community
 Version:           20.10.22
 API version:       1.41
 Go version:        go1.18.9
 Git commit:        3a2c30b
 Built:             Thu Dec 15 22:28:08 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.22
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.9
  Git commit:       42c8b31
  Built:            Thu Dec 15 22:25:58 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.14
  GitCommit:        9ba4b250366a5ddde94bb7c9d1def331423aa323
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

标签:20.4,version,aliyun,ubuntu,http,docker,com
From: https://www.cnblogs.com/gatling/p/17013411.html

相关文章

  • Linux开启ssh并允许root登录(ubuntu、centos、kalilinux)
    1、Ubuntu开启ssh服务及允许root登录1)安装ssh服务器端Ubuntu默认没有安装ssh的server,需要安装apt-getinstallopenssh-serverssh客户端是默认安装的,连接其它ssh服......
  • MongoDB从入门到实战之Docker快速安装MongoDB
    前言   在上一篇文章中带领带同学们快速入门MongoDB这个文档型的NoSQL数据库,让大家快速的了解了MongoDB的基本概念。这一章开始我们就开始实战篇教程,为了快速把Mong......
  • Ubuntu Docker安装
    一步到胃https://blog.csdn.net/qq_44732146/article/details/121207737换源https://zhuanlan.zhihu.com/p/347643668重启systemctlrestartdocker查看配置docker......
  • docker安装mongodb
    dockerrun-d\--namemongodb\--restartalways\--privileged\-p27017:27017\-v/data/mongodb/data:/data/db\-eMONGO_INITDB_ROOT_USERNAME......
  • Ubuntu20.04更换系统默认启动内核
    一、Ubuntu20.04更换系统默认启动内核,【采用apt更新在线内核】参考:https://blog.csdn.net/weixin_46584887/article/details/125973263二、操作步骤首先使用如下命......
  • docker compose安装与使用
    简介之前使用docker时,写完一个项目之后需要定义一个dockerfile,再通过dockerbuild生成一个镜像,并通过dockerrun执行;都是通过手动操作,用于单个容器,非常麻烦,现在想要的效......
  • ubuntu安装docker
    1.先卸载旧版,如果没有的话,就不用执行了,直接第二步。apt-getremovedockerdocker-enginedocker.iocontainerdrunc2.在终端输入aptupdateapt-getinstallca-certifi......
  • 安装virtualbox及ubuntu
    https://www.virtualbox.org/wiki/Downloads https://releases.ubuntu.com/bionic/下载一个iso然后按步骤安装。  最后修改网络模式  如果使用xshell,需要......
  • 随笔(十三)『docker安装redis』
    1、进入虚拟机vagrantssh2、切换为rootsuroot3、拉取redis镜像dockerpullredis4、创建实体并启动4.1)mkdir-p/mydata/redis/conf4.2)touch/mydata/redis......
  • vm12 安装ubuntu15.10详细图文教程 虚拟机安装ubuntu安装 ubuntu更新软件 ubuntu一直
    vm12安装ubuntu15.10详细图文教程虚拟机安装ubuntu安装ubuntu更新软件ubuntu一直卡在下载语言怎么办官网下载ubuntu下载ubuntu镜像文件虚拟机安装......