yum 安装部署 docker-ce

一、yum安装Docker

本案例要求配置本地yum源并安装Docker:

  • 准备1台虚拟机,IP为192.168.137.100, 网络设置为NAT模式
  • 安装docker
  • 关闭防火墙
  • 关闭SELINUX

实现此案例需要按照如下步骤进行。

 

步骤一:配置yum源

1、Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。

通过 uname -r 命令查看你当前的内核版本

 

2、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的

yum install -y yum-utils device-mapper-persistent-data lvm2

 

3、设置yum源

yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum list docker-ce –show-duplicates 查看源里docker 的版本

 

4、安装docker

yum install docker-ce #ce属于社区版,EE属于企业版(yum install docker-ce-17*)

 

5、Docker配置文件 – daemon.json

daemon.json 文件是 docker 的配置参数,默认安装 docker 后是没有这个文件的,需要手动来创建:

如果在 daemon.json 文件中进行配置,需要 docker 版本高于 1.12.6 (在这个版本上不生效,1.13.1 以上是生效的)

 

vim /etc/docker/daemon.json

{

"graph": "/data/docker", # docker的工作目录

"storage-driver": "overlay2", # 存储驱动

"insecure-registries": ["registry.access.redhat.com", "quay.io"], # 仓库

"registry-mirrors": ["https://q2gr04ke.mirror.aliyuncs.com"], # 阿里云的加速源

"bip": "192.168.100.100/24", # ip地址的定位,最好与外界物理机能直接互通

"exec-opts": ["native.cgroupdriver=systemd"], # cpu内存资源的控制组

"live-restore": true # docker引擎死了,不影响docker引擎启动的容器

}

 

6、启动服务,开机自启

systemctl enable docker

systemctl start docker

文章来源:https://www.cnaaa.net,转载请注明出处:https://www.cnaaa.net/archives/7136

(0)
杰斯的头像杰斯
上一篇 2023年2月7日 下午5:43
下一篇 2023年2月9日 下午2:00

相关推荐

  • CentOS7系统开机报错:you might want to save “/run/initramfs/rdsosreport.txt“ to a USB stick or /boot…

    一、报错场景我遇到的场景是Centos7强制下电,开机后报错,报错的大致意思是系统文件出现错误 具体报错如下 you might want to save “/run/initramfs/rdsosreport.txt“ to a USB stick or /boot after mounting them and attach it to a bug re…

    2023年10月16日
    1.5K00
  • 安装linux/Centos系统出现An Unknown Error Has Occurred报错原因和解决方法

    今天在给一个客户重装系统的时候出现: An Unknown Error Has OccurredThis program has encountered an unknown error. You may report the buy below or quit the program. This program has encountered an unk…

    2024年1月22日
    1.9K00
  • Centos如何通过Nexus代理yum源

    一 背景 公司的某些服务器不允许连接外网,造成这些服务器需要安装软件时非常不方便,此文章则是介绍如何通过Nexus3.x代理yum源,做到通过yum install来安装软件。 二 创建yum代理仓库 三 服务器上增加yum源 四 Yum安装软件

    2023年5月15日
    1.5K00
  • Centos7下FTP安装与配置

    一、前述 企业中linux搭建ftp服务器还是很实用的,所以本文基于Centos7搭建服务器教程做个总结。 FTP协议占用两个端口号: 21端口:命令控制,用于接收客户端执行的FTP命令。 20端口:数据传输,用于上传、下载文件数据。 二、服务端安装 1.安装vsftpd yum -y install vsftpd 2.配置vsftp vim /etc/vs…

    2022年6月15日
    1.4K00
  • IPMItool 控制风扇转速

    近期由于需要测试dell服务器,风扇声音非常的大,通过IPMI页面发现不能设置风扇的转速,所以使用通过IPMItool工具来进行控制 首先进入服务器,安装IPMItool工具 apt install ipmitool 验证是否能够使用 如果不在本机服务器上操作,需要从其他机器上操作,需要勾选IPMI设置,允许通过lan进行操作 获取风扇的速度 首先你要输入下…

    2024年4月12日
    1.7K00

在线咨询: QQ交谈

邮件:712342017@qq.com

工作时间:周一至周五,8:30-17:30,节假日休息

关注微信