首页 > 系统相关 >Wsl2安装CentOS7

Wsl2安装CentOS7

时间:2023-02-12 20:37:31浏览次数:65  
标签:centos7 centos Wsl2 CentOS7 root docker 安装 localhost128

Wsl2安装CentOS7

(或任何你想安装的Linux发行版)

前提条件:安装了虚拟机,且安装好了Docker

  1. 找到你想要的CentOS版本 CentOS的DockerHub地址

  2. 下载docker镜像(我这里是因为已经下载好了,所以显示的结果是这样)

    [root@localhost128 ~]# docker pull centos:centos7
    centos7: Pulling from library/centos
    Digest: sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e
    Status: Image is up to date for centos:centos7
    docker.io/library/centos:centos7
    
  3. 查看已经下载好的镜像

    [root@localhost128 ~]# docker images
    REPOSITORY               TAG             IMAGE ID       CREATED         SIZE
    centos                   centos7         8652b9f0cb4c   9 months ago    204MB
    
  4. 启动centos并查看启动后的容器

    [root@localhost128 ~]# docker run centos:centos7
    [root@localhost128 ~]# docker ps -a
    CONTAINER ID   IMAGE            COMMAND       CREATED         STATUS              
    44604d80ea3a   centos:centos7   "/bin/bash"   9 seconds ago   Exited (0) 7 seconds ago      
    
  5. 导出刚刚启动的容器

    [root@localhost128 ~]# docker export 44604d80ea3a >  centos7.tar
    [root@localhost128 ~]# ls
    anaconda-ks.cfg  centos7.tar
    
  6. 把刚刚导出的容器下载到本地电脑上

  7. 安装刚刚导出的CentOS7 Wsl2命令文档

    wsl --import  centos7  D:\Linux\CentOS7   D:\Linux\centos7.tar
    

导出centos7.tar包过程截图

标签:centos7,centos,Wsl2,CentOS7,root,docker,安装,localhost128
From: https://www.cnblogs.com/xysgo/p/16883568.html

相关文章

  • MySQL本地安装配置
    MySQL本地安装配置地址:https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19-winx64.zip配置出错重开scdeletemysql配环境变量:Path,安装目录\bin安装目录下......
  • supervisor 安装和基本使用
    安装yuminstallsupervisortouch/var/run/supervisor/supervisor.sockchmod777/var/run/supervisor/supervisor.socksupervisordsupervisorctlstartallsuper......
  • Gitbook的安装和部署
    安装npminstallgitbook-cli-ggitbook命令:gitbookinit//初始化目录文件gitbookhelp//列出gitbook所有的命令gitbook--help//输出gitbook-cli的帮助信息git......
  • Gogs安装
    Gogs环境要求我以rhel6.3为例,已经属于生命周期边缘了#安装gityuminstall-ygitgit--versiongitversion1.7.1#安装mysql-serveryuminstall-ymysql-server......
  • tomcat安装配置
    Tomcat下载 下载网址ApacheTomcat-ApacheTomcat®9软件下载 在左侧找到需要下载的版本,然后在右侧选择对应的环境 Tomcat环境配置在我的电脑中点击系统属性......
  • mac 安装 rbenv
    brewinstallrbenv#用来编译安装rubygitclonehttps://github.com/rbenv/ruby-build.git~/.rbenv/plugins/ruby-build#用来管理gemset,可选,因为有bundler......
  • 【前端工具】nodejs+npm+vue 安装(windows)
    预备先看看这几个是干嘛的,相互的关系是啥。nodejs是语言,类比到php。npm是个包管理,类比到composer。vue是个框架,类比到laravel。webpack是个打包工具。先下载nodejs......
  • ubuntu 安装 github desktop
    原文:https://gist.github.com/berkorbay/6feda478a00b0432d13f1fc0a50467f1sudowgethttps://github.com/shiftkey/desktop/releases/download/release-3.1.1-linux1/Gi......
  • centos7部署redis
    参考文档https://redis.io/docs/getting-started/installation/install-redis-from-source/https://blog.csdn.net/weixin_45550937/article/details/1240920771、安......
  • docker的安装及常用命令
    安装docker(ubuntu16.0)1.首先更新源-apt-getupdate2.安装docker-aptinstalldocker常用命令1.查看本地镜像仓库-dockerimagesrepository-镜像名称TAG-镜像描述(l......