Installing Docker on CentOS 7 / RHEL 7

Centos7系统创建用户时出现“useradd: user ‘xxxx‘ already exists”错误(部署sssd启用ldap认证导致—> “ldap中包含创建的用户” ) Centos7系统上创建用户时出现“useradd: user 'xxxx' already exists”错误1、假设您正在尝试添加一个名为“leojiang”的用户并且您收到以下错误。2、调查,先查看系统上是否存在这个用户`leojiang`3、运行getent命令从名称服务切换库(Name Service Switch)中获取4、来让我们找到它,深入研究名称服务切换库配置文件。5、解决方案 背景: Centos7上需要创建一个用户leojiang,而用户时间不纯在系统上,但是还是报错说用户已经存在。 阅读详情

Docker is a container virtualization technology that has gained widespread popularity in recent times; it offers a more efficient way to deploy the application. With Docker, the applications reside inside the container on top of the Linux operating system. Docker uses Kernel features such as cgroups and namespace to allow an independent container to run on single os instance.

In this post, you will learn how to install Docker on CentOS 7 / RHEL 7

Docker runs only on 64-bit operating system.

Installing Docker:

Choose any one of the methods to install Docker on CentOS 7.

Install from Docker (Official):

Docker is now available in two editions,

  • Community Edition (CE)
  • Enterprise Edition (EE)

Here, we will install Docker Comunity Edition (CE).

Uninstall older versions of Dockers, named “docker” or “docker-engine” along with associated dependencies.

# yum  -y remove  docker-common docker container-selinux docker-selinux docker-engine

Do not worry about the contents inside /var/lib/docker/, all will be preserved.

The Docker Comunity package is now called “docker-ce“. Let’s add the CE repository for docker installation.

# yum -y install  wget
# wget https://download.docker.com/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo

Install the latest version of Docker CE using the following command.

# yum -y install docker-ce
Sometime you may want to install particular version of Docker, you do that by appending version like docker-ce-[version]
Eg: yum install docker-ce-17.03.0.ce-1.el7.centos

Install from Base Repository:

Docker is available in the standard repository of CentOS, so we don’t have to search for the package. For RHEL 7, you must have a valid Redhat subscription to enable Extras rpm’s repository on the server. Install it using the following command.

# yum -y install docker

Working with Docker:

Now you have Docker installed onto your machine, start the Docker service in case if it is not started automatically after the installation

# systemctl start docker.service

# systemctl enable docker.service

Troubleshoot:

While starting Docker on CentOS 7, I got a below error.

Apr 18 01:21:00 server docker: /usr/bin/docker: relocation error: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference

I solved this by installing following packages on CentOS 7.

# yum -y install device-mapper device-mapper-event device-mapper-libs device-mapper-event-libs

Credit: Stackoverflow

Restart Docker service on CentOS 7.

# systemctl restart docker.service

Once the service is started, verify your installation by running the following command.

# docker run -it centos echo Hello-World

Let’s see what happens when we run “docker run” command. Docker starts a container with centos base image since we are running this centos container for the first time, the output will look like below.

Unable to find image 'centos:latest' locally
Trying to pull repository docker.io/centos ...
0114405f9ff1: Download complete
511136ea3c5a: Download complete
b6718650e87e: Download complete
3d3c8202a574: Download complete
Status: Downloaded newer image for docker.io/centos:latest
Hello-World

Docker looks for centos image locally, and it is not found, it starts downloading the centos image from Docker registry. Once the image has been downloaded, it will start the container and echo the command “Hello-World” in the console which you can see at the end of the output.

Allowing Non-root access:

As you can see in my command, for CentOS, I had to run Docker as a root user. To avoid this, you can follow below procedure to allow non-root users to run Docker containers.

Create a group called docker if it does not exist, run the following commands with root privileges.

# groupadd docker

Add a user that is to be a part of docker group, replace “raj” with your own username.

# useradd raj

Add a user to docker group.

# usermod -aG docker raj

Now you can run a Docker with a non-root user.

FirewallD:

FirwallD in CentOS 7 can conflict with Docker; it is recommended to disable the service.

# systemctl stop firewalld.service
# systemctl disable firewalld.servic

When firewalld is started or restarted it will remove the DOCKER chain from iptables, it prevents Docker from working properly.

If you still want to use Systemd, firewalld is must be started before Docker service. In case if you start or restart firewalld after Docker, you will have to restart the Docker daemon.

That’s All!, You can now start working with Docker.




from:  http://www.itzgeek.com/how-tos/linux/centos-how-tos/installing-docker-on-centos-7-rhel-7-fedora-21.html

CentOS/RHEL内网Docker部署全攻略 本文详细记录了在CentOS/RHEL系统上使用Docker部署内网微服务基础设施的全过程。部署内容包括MySQL 8.0.36、PostgreSQL 16.4、Redis 7.2.5和Nacos 2.4.0服务注册与配置中心。文档从环境准备开始,详细说明了Docker安装配置、各服务部署步骤、初始化脚本编写到服务验证方法。同时提供了统一管理脚本、诊断工具和常见故障排除方案,包含服务状态检查、健康验证、日志查看等功能。最后汇总了各服务的访问信息、数据持久化目录位置以及后续维护建议,为内网微服务环境的搭建和管 阅读详情

相关推荐

docker-systemctl-replacement:docker systemctl替换-允许部署到受systemd控制的容器,而无需启动实际的systemd守护程序(例如centos7,ubuntu16)

。 。 。 (进行检查:来自400多个测试用例的代码覆盖率达到93%) docker systemctl更换 该脚本可用于覆盖“ / usr / bin / systemctl”。 它将在没有SystemD的情况下执行systemctl命令! 这用于测试以Docker容器为目标主机的服务的部署。 就像在实际计算机上一样,您可以使用“ systemctl start”和“ systemctl enable”以及其他命令来调出服务以进行进一步的配置和测试。 来自“ systemctl show”的信息使部署自动化工具可以正常工作。 该脚本还可以作为docker容器的docker-init运行(即PID 1上的主“ CMD”),在该脚本中它将自动在“ multi-user.target”中启动所有启用的服务,并在其中收获所有僵尸。来自容器中的后台进程。 在这样的容器上运行“ docker s

docker命令需要sudo

sudo groupadd docker # 将当前用户加入docker组 sudo usermod -aG docker $USER # 重载会话(无需exit) newgrp - docker #重启docker进程 sudo systemctl .restart docker

jaket5219999的博客 4508

Cadence公司的数字IC设计工具:综合工具(Genus)——(2)

介绍Cadence公司的数字IC设计工具Genus

qq_42922513的博客 1944

DPlayer-node安装docker报错:localunixsocket is it running?

解决: 将自己的用户添加到docker的group中 [admin@d-lap DPlayer-node]$ sudo usermod -aG docker ${USER} 这里可能会出现一个错误:usermod: group 'docker' does not exist 这是因为在安装docker的使用如果使用npm install来安装,它是不会给你创建docker的group的,所以我们需要自己创建一个 创建一个docker的group [admin@d-lap DPlayer-nod

杨光 1721

华为防火墙 策略路由实现多ISP接入Internet

PC3上网访问Server1时走ISP1。PC4上网访问Server1时走ISP2。1、配置接口IP并加入相应的安全区域。二、ISP2 运营商 R2路由器。一、ISP1 运营商 R1路由器。

一直被模仿,从未被超越 3014

Dify插件离线部署全攻略:从下载到安装的完整流程

本文详细介绍了Dify插件离线部署的完整流程,针对企业内网等无网络环境需求。核心步骤包括在联网环境下载插件包、在特定Python 3.12.9环境下使用专用工具进行离线重打包,以及最终在离线Dify环境中安装验证。重点解决了离线安装的核心难题,并提供了环境配置、批量处理和故障排查等实用技巧,帮助用户实现Dify插件的顺利离线部署。

seed的博客 657

Docker: driver failed programming external connectivity on endpoint xxx 问题分析及解决

问题如下: 重启容器发现无法正常启动,报错:driver failed programming external connectivity on endpoint xxx 问题分析: 首先理清一下我做了什么操作。我记得在我开启docker后,执行 docker-compose up -d 启动完容器后,发现无法连接 MySQL 容器,经查没有关闭防火墙,未开放3306端口,因此执行 systemctl stop firewalld.service 关闭防火墙,最后我 docker-compose rest

Specif1c的博客 2万+

给IC设计新人的Tessent Scan入门指南:从RTL到ATPG的完整DFT流程解析

本文为IC设计新手提供Tessent Scan的完整DFT流程指南,从RTL代码检查到ATPG测试向量生成,详细解析扫描链配置、插入及验证的关键步骤。通过实战案例和工具命令示例,帮助工程师快速掌握Tessent工具链的应用技巧,提升芯片可测试性设计的效率和质量。

weixin_32541663的博客 451

gpasswd 命令详解

1、gpasswd命令是Linux下工作组文件/etc/group和/etc/gshadow的管理工具,用于指定要管理的工作组。 2、选项详解: -a : 添加用户到组 -d : 从组删除用户 -A:指定管理员 -M:指定组成员和-A的用途差不多; -r:删除密码; -R:限制用户登入组,只有组中的成员才可以用n...

weixin_30877181的博客 1194

拆解特斯拉Optimus的关节技术:谐波减速器在仿人机器人中的5个精妙设计

本文深度解析特斯拉Optimus仿人机器人关节中的谐波减速器技术,揭示其五大工程突破:微型化材料革命、两万分之一圈精度实现、碳纤维柔轮轻量化、智能运维系统及国产替代方案。重点探讨谐波减速器如何通过创新设计和先进材料实现精准传动,为仿人机器人提供高效可靠的关节动力解决方案。

omega的博客 1075

从零开始,用Cadence Virtuoso手把手仿真一个1.5V LDO(附完整电路与仿真脚本)

本文详细介绍了如何使用Cadence Virtuoso从零开始仿真一个1.5V LDO,包括环境准备、电路导入、Testbench构建、核心仿真类型分析以及高级调试技巧。通过完整的电路与仿真脚本,帮助读者掌握LDO设计与仿真的关键技术,提升电路设计能力。

weixin_31309419的博客 445

如何在 CentOS 7 / RHEL 7 上安装 Docker

Docker是一种近来广为流行的容器虚拟化技术;它提供了一种更有效的方式来部署应用程序。使用Docker,应用程序驻留在 Linux 操作系统之上的容器内。 Docker使用 cgroups 和 namespace 等内核特性来允许独立容器在单个 os 实例上运行。 在这篇文章中,您将学习如何在CentOS 7 / RHEL 7上安装 Docker。 安装 Docker 选择任何一种方法在CentOS 7上安装 Docker。 从 Docker 安装(官方) 从基本存储库安装 从 D..

allway2的博客 3261

Flink实战案例(十三):Flink DataStream 八大分区策略与自定义分区器

声明:本系列博客是根据SGG的视频整理而成,非常适合大家入门学习。 《2021年最新版大数据面试题全面开启更新》 分区策略决定了一条数据如何发送给下游。Flink中默认提供了八大分区策略(也叫分区器)。 本文基于Flink 1.9.0总结Flink DataStream中的八大分区策略以及手动实现一个自定义分区器。 八大分区策略继承关系图 ChannelSelector: 接口,决定将记录写入哪个Channel。有3个方法: void setup(int numberOfChannels):

微信搜:import_bigdata,大数据领域硬核原创作者 1124

CentOS8 与 CentOS7 的区别

CentOS8 与 CentOS7 的区别。

RAB 3万+

perl 安装DBI和DBD

还可以从cpan.perl.org站点下载tar压缩文件形式的源代码发行版本,解压缩后,切换到相应的文件目录 cd DBI-1.54 perl Makefile.PL make make test make install 安装DBD时候 需要export ORACLE_HOME 验证安装: perldoc DBD::Oracle perldoc DBI 在线文档; perldoc -m

zhaoyangjian724的专栏 1754

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

在离线环境中将 CentOS 7.x 原地迁移至 RHEL 7.9(视频)

Convert2RHEL 是 RedHat 提供的一个命令行工具,用于分析系操作统的情况,并将基于 RPM 的 Linux 操作系统转换为红帽企业 Linux。它支持将 CentOS Linux 7 和 Oracle Linux 7 以及 Alma Linux 8、Oracle Linux 8、CentOS Linux 8 和 Rocky Linux 8 的转换到对应版本的 RHEL。

多恩斯基的博客 2461

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

Centos7下安装Docker(详细安装教程)

一,Docker简介 百科说:Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上,也可以实现虚拟化,容器是完全使用沙箱机制,相互之间不会有任何接口。 看起来有点雾,用过虚拟机的应该对虚拟化技术有点印象,不知道也没关系,就把它当成轻量级的虚拟机吧(虽然一个是完全虚拟化,一个是操作系统层虚拟化),这个解释到位:ht...

u014069688的博客 16万+

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

两步将 CentOS 6.0 原地迁移至 RHEL 7.9 (视频)

本文介绍如何将一个 CentOS 6.0 的系统升级并转换迁移到 RHEL 7.9。

多恩斯基的博客 1643

【RHEL7/CentOS7基本配置】

目录 "@ 相比于6.x的版本,Rhel7/CentOS7增加或改进了以下7大特性。 1.身份管理 kerberos的跨平台信任机制:kerberos将完全兼容微软活动目录,实现完全使用活动目录进行认证。 REALMD:该功能简化了RHEL加入微软活动目录的配置,支持自动发现域信息。 RHEL7增加了这两个关键性的新特征改善了RHE...

weixin_30505225的博客 224

RHEL 7 使用 CentOS 源安装 docker ce

文章目录1. rhel 安装 docker ce 需求2. 使用 CentOS7 源代替 rhel 源3. 制作 docker ce 离线安装包 1. rhel 安装 docker ce 需求 RHEL 7 上安装 docker ce,但是官方提示并不支持,使用相应的源也会报依赖错误。那我非要安装呢? 2. 使用 CentOS7 源代替 rhel 源 直接到阿里云镜像源上把 base、epel、docker ce的 yum repo文件下载好,因为 rhel 不认识 CentOS 源中的这种变量 $rel

ygqygq2的IT博客 1192

第一部分:在CentOS和RHEL 8/7中安装Docker并学习基本的容器操作

本系列共4篇文章,我们将讨论Docker,它是一个开源的轻量级虚拟化工具,运行在操作系统级别之上,允许用户创建、运行和部署应用程序,并将其封装在小型容器中。 这种类型的Linux容器被证明是快速、可移植和安全的。在Docker容器中运行的进程始终与主机隔离,防止外界的篡改。 本教程提供了一个关于如何在CentOS/RHEL 8/7上安装Docker、创建和运行Docker容器的起点,但也仅仅接触到了Docker的表面。 一、安装和配置Docker 早期的Docker版本被称为docker或docker-e

A5数据 892

如何在CentOS 7 / RHEL 7上安装Kubernetes(k8s)1.7

Kubernetes 是一个可移植的、可扩展的开源平台,用于管理容器化的工作负载和服务,可促进声明式配置和自动化。Kubernetes 拥有一个庞大且快速增长的生态系统。Kubernetes 的服务、支持和工具广泛可用。 Kubernetes源于希腊语,意为 “舵手” 或 “飞行员”。Google 在 2014 年开源了 Kubernetes 项目。Kubernetes 建立在Google ...

逗点云 1007

RHEL7/CENTOS7 新特性

RHEL7/CENTOS7新特性: 1、身份管理 •kerberos的跨平台信任机制:kerberos将完全兼容微软活动目录,实现完全使用活动目录进行认证。 •REALMD:该功能简化了RHEL加入微软活动目录的配置,支持自动发现域信息。 RHEL 7增加了两个关键性的新特征改善了RHEL对AD的处理方式。现在,RHEL 7和AD之间建立了跨域信任(Cross...

程序猿的专栏 300

docker新建Linux虚拟机,RHEL/CentOS 7下创建你的第一个Docker容器

Docker容器人气一直在增长。他们现在正在快速采用,正在取代虚拟机,特别是在应用程序开发方面。在本教程中,我们将讨论Docker容器的内容,并将学习在RHEL/CentOS 7上安装它的过程。Docker容器提供了在单个服务器或主机上运行多个独立系统的方法。每个容器共享主机操作系统的内核(也是库)。而且,由于每个使用的容器都与主机共享操作系统,因此Docker容器非常小。事实上,Docker容器...

weixin_36212400的博客 302

RHEL8安装docker-ce

RHEL8安装docker-ce

教Linux的李老师 5101
上一篇: 阿里云CentOS7挂载SSD云盘的方法
下一篇: eslint: prop type 'object' is forbidden(react/forbid-prop-types)
asc2046
博客等级 码龄13年 7粉丝 63原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值