Ubuntu 系统,Docker 安装步骤 [Ubuntu 22.4已验证]

Ubuntu 系统,Docker 安装步骤 :

1. 更新包索引并安装必要的依赖包:

sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

2. 添加 Docker 的官方 GPG 密钥:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

3. 添加 Docker 的软件源:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

4. 更新包索引并安装 Docker CE:

sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io

5. 启动 Docker 并 使能 服务:

sudo systemctl start docker
sudo systemctl enable docker

6. 验证 Docker 是否安装成功:

docker --version
[jn@jn jsoncpp]$ docker --version
Docker version 26.1.2, build 211e74b
[jn@jn jsoncpp]$

7. 运行状态查看

[jn@jn jsoncpp]$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-05-13 23:13:48 +08; 3min 10s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 1493343 (dockerd)
      Tasks: 16
     Memory: 31.0M
        CPU: 231ms
     CGroup: /system.slice/docker.service
             └─1493343 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Mei 13 23:13:47 jn systemd[1]: Starting Docker Application Container Engine...
Mei 13 23:13:47 jn dockerd[1493343]: time="2024-05-13T23:13:47.617402528+08:00" level=info msg="Starting up"
Mei 13 23:13:47 jn dockerd[1493343]: time="2024-05-13T23:13:47.745766561+08:00" level=info msg="Loading containers: start."
Mei 13 23:13:47 jn dockerd[1493343]: time="2024-05-13T23:13:47.984743141+08:00" level=info msg="Loading containers: done."
Mei 13 23:13:48 jn dockerd[1493343]: time="2024-05-13T23:13:48.019822580+08:00" level=info msg="Docker daemon" commit=ef1912d container>
Mei 13 23:13:48 jn dockerd[1493343]: time="2024-05-13T23:13:48.019886045+08:00" level=info msg="Daemon has completed initialization"
Mei 13 23:13:48 jn dockerd[1493343]: time="2024-05-13T23:13:48.036506531+08:00" level=info msg="API listen on /run/docker.sock"
Mei 13 23:13:48 jn systemd[1]: Started Docker Application Container Engine.
lines 1-20/20 (END)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值