centos7中安装docker root用户

 

001、查看系统信息

[root@PC1 software]# hostnamectl
   Static hostname: PC1
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 7c6deea1d66945718f62729ea78d608a
           Boot ID: f5e10eb6274c4768a998ed5441976be3
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-957.el7.x86_64
      Architecture: x86-64

 

002、下载安装包

wget https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-ce-24.0.7-1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-24.0.7-1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/containerd.io-1.6.21-3.1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm
wget https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-compose-plugin-2.6.0-3.el7.x86_64.rpm

下载结果如下:

 

003、安装docker

[root@PC1 software]# rpm -ivh *.rpm --nodeps --force
warning: containerd.io-1.6.21-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:docker-compose-plugin-0:2.6.0-3.e################################# [ 20%]
   2:docker-buildx-plugin-0:0.11.2-1.e################################# [ 40%]
   3:docker-ce-cli-1:24.0.7-1.el7     ################################# [ 60%]
   4:containerd.io-1.6.21-3.1.el7     ################################# [ 80%]
   5:docker-ce-3:24.0.7-1.el7         ################################# [100%]

 

004、测试环境

[root@PC1 software]# docker --version         ## 查看docker版本
Docker version 24.0.7, build afdd53b
[root@PC1 software]# systemctl status docker     ## 查看docker服务状态
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

 

005、配置环境

[root@PC1 software]# systemctl start docker         ## 启动docker
[root@PC1 software]# systemctl status docker        ## 查看docker服务状态
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2025-05-08 22:38:53 CST; 2s ago
     Docs: https://docs.docker.com
 Main PID: 18680 (dockerd)
    Tasks: 10
   Memory: 26.6M
   CGroup: /system.slice/docker.service
           └─18680 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

May 08 22:38:52 PC1 systemd[1]: Starting Docker Application Container Engine...
May 08 22:38:52 PC1 dockerd[18680]: time="2025-05-08T22:38:52.547085748+08:00" level=info msg="Starting up"
May 08 22:38:52 PC1 dockerd[18680]: time="2025-05-08T22:38:52.572940632+08:00" level=info msg="Loading containers: start."
May 08 22:38:53 PC1 dockerd[18680]: time="2025-05-08T22:38:53.543528169+08:00" level=info msg="Firewalld: interface docker0...urning"
May 08 22:38:53 PC1 dockerd[18680]: time="2025-05-08T22:38:53.634020121+08:00" level=info msg="Loading containers: done."
May 08 22:38:53 PC1 dockerd[18680]: time="2025-05-08T22:38:53.662494416+08:00" level=info msg="Docker daemon" commit=311b9f...=24.0.7
May 08 22:38:53 PC1 dockerd[18680]: time="2025-05-08T22:38:53.662956700+08:00" level=info msg="Daemon has completed initialization"
May 08 22:38:53 PC1 dockerd[18680]: time="2025-05-08T22:38:53.687220362+08:00" level=info msg="API listen on /run/docker.sock"
May 08 22:38:53 PC1 systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@PC1 software]# systemctl enable docker          ## 设置开机自动启动
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

 。

 

posted @ 2025-05-08 22:41  小鲨鱼2018  阅读(42)  评论(0)    收藏  举报