IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> docker 安装 -> 正文阅读

[系统运维]docker 安装

centos7.9

系统环境

[root@centos7 ~]#uname -a
Linux centos7 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@centos7 ~]#cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

安装的docker版本

[root@centos7 ~]#docker version
Client: Docker Engine - Community
 Version:           19.03.15
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        99e3ed8
 Built:             Sat Jan 30 03:11:43 2021
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.15
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       99e3ed8
  Built:            Sat Jan 30 03:18:13 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.9
  GitCommit:        ea765aba0d05254012b0b9e595e995c09186427f
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

编译安装之后启动报错

[root@centos7 ~]#systemctl start docker
A dependency job for docker.service failed. See 'journalctl -xe' for details.
[root@centos7 ~]#journalctl -xe
-- Unit network.service has finished starting up.
--
-- The start-up result is done.
Mar 11 04:53:20 centos7.kktb.org sshd[2431]: Accepted password for root from 10.0.0.1 port 50500 ssh2
Mar 11 04:53:20 centos7.kktb.org systemd-logind[621]: New session 7 of user root.
-- Subject: A new session 7 has been created for user root
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A new session with the ID 7 has been created for the user root.
--
-- The leading process of the session is 2431.
Mar 11 04:53:20 centos7.kktb.org systemd[1]: Started Session 7 of user root.
-- Subject: Unit session-7.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-7.scope has finished starting up.
--
-- The start-up result is done.
Mar 11 04:53:20 centos7.kktb.org sshd[2431]: pam_unix(sshd:session): session opened for user root by (uid=0)
Mar 11 04:53:36 centos7.kktb.org polkitd[620]: Registered Authentication Agent for unix-process:2479:798706 (system bus name :1.65 [/usr/bin/pkttyagen
Mar 11 04:53:36 centos7.kktb.org systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has begun starting up.
Mar 11 04:53:36 centos7.kktb.org systemd[2485]: Failed to chown socket at step GROUP: No such process
Mar 11 04:53:36 centos7.kktb.org systemd[1]: docker.socket control process exited, code=exited status=216
Mar 11 04:53:36 centos7.kktb.org systemd[1]: Failed to listen on Docker Socket for the API.
-- Subject: Unit docker.socket has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has failed.
--
-- The result is failed.
Mar 11 04:53:36 centos7.kktb.org systemd[1]: Dependency failed for Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is dependency.
Mar 11 04:53:36 centos7.kktb.org systemd[1]: Job docker.service/start failed with result 'dependency'.
Mar 11 04:53:36 centos7.kktb.org systemd[1]: Unit docker.socket entered failed state.
Mar 11 04:53:36 centos7.kktb.org polkitd[620]: Unregistered Authentication Agent for unix-process:2479:798706 (system bus name :1.65, object path /org

创建docker组之后,重新启动即可

[root@centos7 ~]#groupadd docker
#启动成功
[root@centos7 ~]#systemctl start docker
[root@centos7 ~]#systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-03-11 04:54:07 GMT; 2min 59s ago
     Docs: https://docs.docker.com
 Main PID: 2501 (dockerd)
    Tasks: 16
   Memory: 22.0M
   CGroup: /system.slice/docker.service
           └─2501 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.142203305Z" level=info msg="scheme \"unix\" not registered, fallb...ule=grpc
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.142216021Z" level=info msg="ccResolverWrapper: sending update to ...ule=grpc
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.142222107Z" level=info msg="ClientConn switching balancer to \"pi...ule=grpc
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.170101868Z" level=info msg="Loading containers: start."
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.289087193Z" level=info msg="Default bridge (docker0) is assigned ...address"
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.322452616Z" level=info msg="Loading containers: done."
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.349804031Z" level=info msg="Docker daemon" commit=99e3ed8 graphdr...19.03.15
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.349871612Z" level=info msg="Daemon has completed initialization"
Mar 11 04:54:07 centos7.kktb.org dockerd[2501]: time="2022-03-11T04:54:07.363256443Z" level=info msg="API listen on /var/run/docker.sock"
Mar 11 04:54:07 centos7.kktb.org systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.

配置docker镜像加速器
这里使用阿里云的镜像加速器,登录阿里云的账号之后,会生成独有的docker加速链接
登录阿里云镜像控制台cr.console.aliyun.com点击镜像工具—>镜像加速器,
验证

[root@centos7 ~]#docker info
Client:
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.7.1-docker)
  scan: Docker Scan (Docker Inc., v0.12.0)

Server:
 Containers: 3
  Running: 0
  Paused: 0
  Stopped: 3
 Images: 1
 Server Version: 19.03.15
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1160.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 7.62GiB
 Name: centos7
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://ixxxxxxx.mirror.aliyuncs.com/     #此处多了一个registry mirrors地址,指定的就是阿里云的docker镜像地址
 Live Restore Enabled: false
 Product License: Community Engine

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-03-12 18:00:11  更:2022-03-12 18:03:49 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/16 1:56:02-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码