虚拟机中Docker部署

本文介绍了如何在虚拟机中安装Docker,包括下载VMware并安装CentOS7镜像,配置阿里云yum源,解决repo问题,以及使用finalshell工具进行远程连接。重点涉及到了镜像文件管理和静态IP设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

虚拟机安装docker

一 :下载vmware并安装centos7镜像文件

二 :安装相关软件和依赖

yum install -y yum-utils device-mapper-persistent-data lvm2
设置阿里yum源

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
列出所有可安装的docker版本

yum list docker-ce --showduplicates | sort -r
选择版本

yum list docker-ce --showduplicates | sort -r
启动docker并查看版本

systemctl start docker
docker version
 

如果有报错
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>


大致意思是说没有可用的repo文件,运行 "yum repolist all"也确实查不到。

换源

 一:  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

二 : wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

三: yum -y install yum-utils 

问题解决

镜像文件  

Index of /centos/7/isos/x86_64/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

使用工具finalshell工具来远程连接docker操作

首先需要给虚拟机中centos设置固定ip地址方便后续连接

虚拟机中Linux系统配置静态IP (详细步骤)_虚拟机配置静态ip-CSDN博客

总结

首先安装虚拟机,之后配置镜像文件,下载docker

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值