首页 > 技术文章 > win10 docker 安装centos7镜像,并安装python环境

chenlizhi 2020-09-12 23:29 原文

  1. 拉取centos镜像
    docker pull centos:centos7
    进入centos
    docker run -it --name centos centos:centos7
    下载wget
    yum -y install wget
  2. 修改yum源对系统yum源进行备份

    • 对系统yum源进行备份
      mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
      • 下载想使用的yum源,这里使用aliyun源
        wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

    • 运行
      yum makecache
      yum -y update

  3. 安装python  
    借鉴 :https://www.cnblogs.com/xiujin/p/11477419.html

推荐阅读