温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

CentOS7虚拟机怎么安装并配置docker套件

发布时间:2022-04-11 17:44:14 来源:亿速云 阅读:155 作者:zzz 栏目:大数据

这篇文章主要介绍“CentOS7虚拟机怎么安装并配置docker套件”,在日常操作中,相信很多人在CentOS7虚拟机怎么安装并配置docker套件问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”CentOS7虚拟机怎么安装并配置docker套件”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

1. 打开vmware, 创建虚拟机, 选择光盘, 下一步

CentOS7虚拟机怎么安装并配置docker套件 

2. 选择传统bios

CentOS7虚拟机怎么安装并配置docker套件 

3.自定设置

CentOS7虚拟机怎么安装并配置docker套件 

4.选择存储虚拟机的位置,存储

CentOS7虚拟机怎么安装并配置docker套件 

5. 自定义内存为2g, 磁盘为40gb

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件 

6. 开机,选择install centos 7

CentOS7虚拟机怎么安装并配置docker套件 

7. 选择语言

 CentOS7虚拟机怎么安装并配置docker套件

8.选择磁盘

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件 

9. 设置预装软件

CentOS7虚拟机怎么安装并配置docker套件

CentOS7虚拟机怎么安装并配置docker套件 

10. 节约内存, 关闭kdump

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件 

11. 开启网络, 设置主机名

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件 

12. 开始安装

CentOS7虚拟机怎么安装并配置docker套件

 13.设置root用户密码, 创建具有sudo权限的用户并设置密码 设置管理员用户

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件 

添加具有sudo权限的用户

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件

等读条完成

CentOS7虚拟机怎么安装并配置docker套件 

重启

CentOS7虚拟机怎么安装并配置docker套件

同意协议

CentOS7虚拟机怎么安装并配置docker套件

CentOS7虚拟机怎么安装并配置docker套件

完成设置

 CentOS7虚拟机怎么安装并配置docker套件

登录

CentOS7虚拟机怎么安装并配置docker套件

开始使用

CentOS7虚拟机怎么安装并配置docker套件

安装成功

CentOS7虚拟机怎么安装并配置docker套件

调整时区

CentOS7虚拟机怎么安装并配置docker套件

CentOS7虚拟机怎么安装并配置docker套件

CentOS7虚拟机怎么安装并配置docker套件 

选择上海

CentOS7虚拟机怎么安装并配置docker套件

CentOS7虚拟机怎么安装并配置docker套件 

安装配置完成, 享受linux吧

CentOS7虚拟机怎么安装并配置docker套件 

centos的优势并不在图形化界面上, 如果你喜欢图形化界面的linux, 这里推荐deepin 和 unbuntu, 如果你对界面的美感要求很高, 建议你试一试号称最美linux的elementaryos

每次拿到一个全新的centos镜像的时候,第一件事就是为centos更换国内源, 新增yum源, 吐槽一下, 默认的yum源对常用软件的支持真的不咋地, 比如我想安装一个 python-pip , 对不起, 没有!

但好在centos也留有余地, 你可以自由地新增一些你喜欢的源, 比如epel(extra packages for enterprise linux)

CentOS7虚拟机怎么安装并配置docker套件 

企业版 linux 附加软件包(以下简称 epel)是一个 fedora 特别兴趣小组,用以创建、维护以及管理针对企业版 linux 的一个高质量附加软件包集,面向的对象包括但不限于 红帽企业版 linux (rhel)、 centos、scientific linux (sl)、oracle linux (ol) 。 epel 的软件包通常不会与企业版 linux 官方源中的软件包发生冲突,或者互相替换文件。epel 项目与 fedora 基本一致,包含完整的构建系统、升级管理器、镜像管理器等等。

第一步: 更换

1.1备份旧的yum源

sudo mv /etc/yum.repos.d/centos-base.repo /etc/yum.repos.d/centos-base.repo.bak

1.2将以下内容写入 /etc/yum.repos.d/centos-base.repo

# centos-base.repo
#
# the mirror system uses the connecting ip address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. you should use this for centos updates
# unless you are manually picking other mirrors.
#
# if the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=centos-$releasever - base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7

#released updates
[updates]
name=centos-$releasever - updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7

#additional packages that may be useful
[extras]
name=centos-$releasever - extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7

#additional packages that extend functionality of existing packages
[centosplus]
name=centos-$releasever - plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7

1.3刷新yum源

yum clean all && yum makecache && yum update

但是yum源的软件还是太少了, 比如我想安装只有 python-pip 都做不到

CentOS7虚拟机怎么安装并配置docker套件 

第二步: 安装阿里epel源

yum -y install epel-release
wget -o /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 刷新yum源
yum clean all && yum makecache && yum update

CentOS7虚拟机怎么安装并配置docker套件 

CentOS7虚拟机怎么安装并配置docker套件 

至此, 我们可以愉快的安装python-pip了, yum install python-pip

CentOS7虚拟机怎么安装并配置docker套件 

第三步: 安装docker和docker-compose

1. 安装docker

# 通过yum源安装docker
sudo yum -y install docker
# 启动docker
sudo systemctl start docker
# 开机自启
sudo systemctl enable docker

CentOS7虚拟机怎么安装并配置docker套件 

2. 安装docker-compose

sudo pip install docker-compose
# 安装成功后查看
sudo docker-compose --version

CentOS7虚拟机怎么安装并配置docker套件 

3. docker 中国官方镜像加速

修改/etc/docker/daemon.json, 加入以下配置

{
"registry-mirrors": ["https://registry.docker-cn.com"]
}

CentOS7虚拟机怎么安装并配置docker套件

重启docker

sudo service docker restart

到此,关于“CentOS7虚拟机怎么安装并配置docker套件”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI