前言

  • CentOS Linux release 8.2
  • CentOS Linux release 7.9

yum源

腾讯云服务器Centos 8、Centos 7版本上的yum中包含了docker,无需配置yum源。

安装 docker

  1. 查看docker
shell> yum info docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Packages
Name        : docker
Arch        : x86_64
Epoch       : 2
Version     : 1.13.1
Release     : 208.git7d71120.el7_9
Size        : 17 M
Repo        : extras/7/x86_64
Summary     : Automates deployment of containerized applications
URL         : https://github.com/docker/docker
License     : ASL 2.0
Description : Docker is an open-source engine that automates the deployment of any: application as a lightweight, portable, self-sufficient container that will: run virtually anywhere.: : Docker containers can encapsulate any payload, and will run consistently on: and between virtually any server. The same container that a developer builds: and tests on a laptop will run at scale, in production*, on VMs, bare-metal: servers, OpenStack clusters, public instances, or combinations of the above.
  1. 安装daocker
shell> yum install -y docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel                                                                                                                                                                                                              | 4.7 kB  00:00:00
extras                                                                                                                                                                                                            | 2.9 kB  00:00:00
os                                                                                                                                                                                                                | 3.6 kB  00:00:00
updates                                                                                                                                                                                                           | 2.9 kB  00:00:00
(1/3): epel/7/x86_64/updateinfo                                                                                                                                                                                   | 1.0 MB  00:00:00
(2/3): epel/7/x86_64/primary_db                                                                                                                                                                                   | 7.0 MB  00:00:01
(3/3): updates/7/x86_64/primary_db                                                                                                                                                                                |  12 MB  00:00:01
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.13.1-208.git7d71120.el7_9 will be installed
--> Processing Dependency: docker-common = 2:1.13.1-208.git7d71120.el7_9 for package: 2:docker-1.13.1-208.git7d71120.el7_9.x86_64
--> Processing Dependency: docker-client = 2:1.13.1-208.git7d71120.el7_9 for package: 2:docker-1.13.1-208.git7d71120.el7_9.x86_64
--> Processing Dependency: subscription-manager-rhsm-certificates for package: 2:docker-1.13.1-208.git7d71120.el7_9.x86_64...(省略)Installed:docker.x86_64 2:1.13.1-208.git7d71120.el7_9                                                                                                                                                                                            Dependency Installed:atomic-registries.x86_64 1:1.22.1-33.gitb507039.el7_8                                audit-libs-python.x86_64 0:2.8.5-4.el7                                   checkpolicy.x86_64 0:2.5-8.el7                                         container-selinux.noarch 2:2.119.2-1.911c772.el7_8                                   container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7                 containers-common.x86_64 1:0.1.40-11.el7_8                             docker-client.x86_64 2:1.13.1-208.git7d71120.el7_9                                   docker-common.x86_64 2:1.13.1-208.git7d71120.el7_9                       fuse-overlayfs.x86_64 0:0.7.2-6.el7_8                                  fuse3-libs.x86_64 0:3.6.1-4.el7                                                      libcgroup.x86_64 0:0.41-21.el7                                           libsemanage-python.x86_64 0:2.5-14.el7                                 oci-register-machine.x86_64 1:0-6.git2b44233.el7                                     oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6                       oci-umount.x86_64 2:2.5-3.el7                                          policycoreutils-python.x86_64 0:2.5-34.el7                                           python-IPy.noarch 0:0.75-6.el7                                           python-dateutil.noarch 0:1.5-7.el7                                     python-dmidecode.x86_64 0:3.12.2-4.el7                                               python-ethtool.x86_64 0:0.8-8.el7                                        python-inotify.noarch 0:0.9.4-4.el7                                    python-pytoml.noarch 0:0.1.14-1.git7dea353.el7                                       python-syspurpose.x86_64 0:1.24.48-1.el7.centos                          setools-libs.x86_64 0:3.3.8-4.el7                                      slirp4netns.x86_64 0:0.4.3-4.el7_8                                                   subscription-manager.x86_64 0:1.24.48-1.el7.centos                       subscription-manager-rhsm.x86_64 0:1.24.48-1.el7.centos                subscription-manager-rhsm-certificates.x86_64 0:1.24.48-1.el7.centos                Complete!
  1. 查看已安装的 docker 的版本
shell> docker version
Client:Version:         1.13.1API version:     1.26Package version:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  1. 启动docker
shell> systemctl start docker
  1. 查看docker运行状态
shell> systemctl status docker
● docker.service - Docker Application Container EngineLoaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)Active: active (running) since Wed 2021-11-17 16:44:59 CST; 20s agoDocs: http://docs.docker.comMain PID: 17532 (dockerd-current)CGroup: /system.slice/docker.service├─17532 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-pr...└─17540 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-contai...Nov 17 16:44:58 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:58.758139169+08:00" level=warning msg="Docker could not enable SELinux on the host system"
Nov 17 16:44:58 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:58.804182251+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Nov 17 16:44:58 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:58.804653182+08:00" level=info msg="Loading containers: start."
Nov 17 16:44:58 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:58.872826409+08:00" level=info msg="Firewalld running: false"
Nov 17 16:44:58 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:58.957010199+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be use...red IP address"
Nov 17 16:44:58 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:58.987554477+08:00" level=info msg="Loading containers: done."
Nov 17 16:44:59 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:59.031567584+08:00" level=info msg="Daemon has completed initialization"
Nov 17 16:44:59 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:59.031591129+08:00" level=info msg="Docker daemon" commit="7d71120/1.13.1" graphdriver=overlay2 version=1.13.1
Nov 17 16:44:59 VM-16-5-centos dockerd-current[17532]: time="2021-11-17T16:44:59.035053083+08:00" level=info msg="API listen on /var/run/docker.sock"
Nov 17 16:44:59 VM-16-5-centos systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
  1. docker 版的 Hello World!
shell> docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ...
latest: Pulling from docker.io/library/hello-world
2db29710123e: Pull complete
Digest: sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685
Status: Downloaded newer image for docker.io/hello-world:latestHello from Docker!
This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64)3. The Docker daemon created a new container from that image which runs theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:https://hub.docker.com/For more examples and ideas, visit:https://docs.docker.com/get-started/

【Centos 8】【Centos 7】腾讯云服务器 安装 docker相关推荐

  1. 部署CentOS可视化界面GUI-之腾讯云服务器

    目录 一.购买云服务器实例 二.配置安全组.设置管理员密码 三.远程登录 四.安装CentOS可视化界面GUI 4.1.系统GUI配置 4.2.系统GUI配置 五.GUI或Console之间的界面切换 ...

  2. 在Linux系统(CentOS 8.2)腾讯云服务器下部署原神云崽机器人(Yunzai-Bot)【保姆入门级】

    在决定记录这篇文章之前,我从几天前开始接触云服务器到一步步部署完成,确实是从无到有,一点点理解一点点实践.实践真的非常重要!!!因为肯定比你看书看教程视频强太多太多.这篇文章仅仅只是做一个我部署成功的 ...

  3. Unirech腾讯云国际版-使用腾讯云服务器手动建立WordPress 个人站点Linux系统教程

    WordPress是用PHP语言开发的博客平台.用户可以使用WordPress来建立自己的博客平台,下面Unirech以CentOS 7.6操作系统的腾讯云服务器为例,简单介绍手动搭建个人WordPr ...

  4. 腾讯云服务器的系统安装

    腾讯云服务器-安装Linux-CentOS镜像(笔记) 大家好,这是我第一次在CSDN上发表文章,也是一个学习编程的新手,如果有问题欢迎留言,大家共同进步 如何购买云服务器的步骤我上传不了,因为没有做 ...

  5. 腾讯云linux数据盘格式化,腾讯云服务器Centos挂载数据盘的方法

    腾讯云服务器Centos挂载数据盘的方法 发布时间:2020-08-24 08:24:30 来源:脚本之家 阅读:138 作者:逐风 栏目:服务器 第一.检查硬盘设备是否有数据盘 # 先执行 fdis ...

  6. CentOS 7 腾讯云服务器 Linux无图形化界面静默安装oracle数据库.

    服务器基础信息 腾讯云 CentOS7.2 64位 root登录系统查看一下版本信息 CentOS Linux release 7.2.1511 (Core) 在安全组中将ORACLE默认通讯端口 T ...

  7. 腾讯云服务器CVM(CentOS 7、Tencent Linux)手动搭建LNMP环境(linux+Nginx+Mariadb+PHP)

    手动搭建云服务器运行环境就是喜欢折腾,如果觉得麻烦的网友可以使用LNMP镜像直接启动CVM实例,以便快速建站. 腾讯云服务器CVM(CentOS 7.Tencent Linux)手动搭建LNMP环境( ...

  8. 远程访问 Linux 服务器中的 redis 数据库(腾讯云服务器 CentOS 8.0)

    远程访问 Linux 服务器中的 redis 数据库(腾讯云服务器 CentOS 8.0) 1. 开放腾讯云服务器防火墙端口 2. 修改 redis.conf 文件配置 3. 设置服务器防火墙状态 4 ...

  9. 腾讯云服务器的环境配置与使用

    一.腾讯云linux云服务器配置LNMP环境 1.登录腾讯云服务器 首先我在腾讯云的官网申请了一个学生版的服务器,操作系统为CentOS 6.3 64位.接下去下载并安装Xshell(一个远程管理li ...

最新文章

  1. kali linux安装wine32,永恒之蓝msf下 ms17_010 (64位kali下安装wine32)
  2. More Effective C++读书笔记(二)
  3. 【干货】目标检测比赛中的trick
  4. 后记:Cookie安全大辩论总结
  5. 关于 SAP Fiori Elements 应用标题属性(title) 的复制逻辑单步调试
  6. EOJ Monthly 2019.2 (based on February Selection) D 进制转换 【数学 进制转换】
  7. Advanced Installer 9.8打包实录
  8. 你是个失败者,有什么资格说话?
  9. C和混编混合编程----strcpy缓存溢出原理
  10. 算法(22)-leetcode-剑指offer6
  11. maven的web工程打包为war并部署到服务器
  12. php+mysql个人博客系统_推荐几个开源的个人独立博客系统
  13. papers to read
  14. Kafka(下):Kafka消费者API,producer拦截器(interceptor)及案例,kafka流Streams,Stream数据清洗案例,Kafka配置信息,flume对接Kafka
  15. 土壤修复废水除镍技术,除镍树脂材料
  16. 理解引用 SqList L 与 SqList L 的区别
  17. 运营小技能:自定义公众号菜单模版(带有文章分类栏目、内容列表)、获取历史页面
  18. 英国易捷航空遭黑客入侵 约900万客户数据被窃取
  19. 桌面窗口管理器 GPU 3D 占用100% 的解决方法
  20. redis高并发下的处理考勤打卡数据

热门文章

  1. shell中的函数、shell中的数组、 告警系统需求分析
  2. 信息安全系统设计基础实验四:外设驱动程序设计 20145222黄亚奇 20145213祁玮
  3. Java后台请求远程链接
  4. href=#与javascript:void(0)的区别
  5. BUTTON标签和INPUT标签的区别【转】
  6. tcp连接的三次握手
  7. C# Hook原理及EasyHook简易教程
  8. C# 将PowerPoint文件转换成PDF文件
  9. WF:要想绑到两个活动的属性值---依赖属性的定义方法
  10. 中判断字符串是否为空_java中的数字以及如何判断字符串是不是数字