查看当前系统版本与内核版本:
root@Cloud-HongKong:~# lsb_release -a
LSB Version: core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
root@Cloud-HongKong:~# uname -a
Linux Cloud-HongKong 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
一、更新系统
提示:根据个人需求来选择是否更新系统!
$ sudo apt update && sudo apt full-upgrade
二、添加 Docker 库
安装必要的依赖项:
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
添加 Docker 的官方 GPG 密钥:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
添加 Docker 官方库:
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
更新 Ubuntu 源列表:
$ sudo apt update
三、安装 Docker
运行下列命令在 Ubuntu 22.04 LTS 服务器安装最新 Docker CE:
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
四、查看 Docker 版本(验证)
执行下面命令查看版本:
$ sudo docker version
输出结果:
Client: Docker Engine - Community
Version: 24.0.2
API version: 1.43
Go version: go1.20.4
Git commit: cb74dfc
Built: Thu May 25 21:51:00 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.2
API version: 1.43 (minimum version 1.12)
Go version: go1.20.4
Git commit: 659604f
Built: Thu May 25 21:51:00 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
docker-init:
Version: 0.19.0
GitCommit: de40ad0
评论前必须登录!
注册