In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to make wsl tar files through Docker. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Recently play VScode remote development function, it can connect Docker container, can also connect wsl,window under the container is running in WSL, then study the direct connection to WSL, and not let Docker this second-hand merchants earn the difference, hehe.
Through the wsl-l-o command, we can see the list of images that can be installed remotely.
Download the image through Microsoft Store is always unable to download, the command line is not good, maybe there is something wrong with the network here (sometimes it can be downloaded, (╯ '□') ╯ download ┻━┻), according to the official website tips, you can use docker to create a tar file and import it into wsl, WSL document, and I also want to install a CentOS to try.
No one runs the operating system just to run the operating system
# pull centos image docker pull centos# to create containers, docker run-it centos# list all containers find centOS containers IDdocker container ls-a # Export distribution docker export c9e89339e9d2 > e:\ centos.tar# import distribution to wsl Command format wsl-- import # remember to create the corresponding folder wsl-- import CentOS E:\ wslDistroStorage\ CentOS e:\ centos.tar# to view the installed wsl wsl-l-v# startup and access to the system wsl-d CentOS# completed, # extension, specify the default distribution, wsl-- setdefault (- s) wsl-s CentOS# specify the default distribution, you can enter it directly, and wsl will enter CentOS by default.
OK complete.
Move the location of the wsl C:\ Users\ Administrator > wsl-- l-v NAME STATE VERSION* docker-desktop Running 2 docker-desktop-data Running export, export the wsl to the specified file C:\ Users\ Administrator > wsl-- export docker-desktop-data "D:\ Docker\ wsl\ data\ docker-desktop-data.tar" # remove the original virtual machine After deletion, all information will be cleared C:\ Users\ Administrator > wsl-- unregister docker-desktop-data # generate a new virtual machine, that is, import the virtual machine at the specified location.-- version 2 is the version of the specified wsl #, if wsl2 has been set to the default value, then you do not need to specify it again. # if there are no special requirements, use the new one. C:\ Users\ Administrator > wsl-- import docker-desktop-data "D:\ Docker\ wsl\ data"D:\ Docker\ wsl\ data\ docker-desktop-data.tar"-- version 2docker
Rename docker Container
Docker rename newName on "how to make wsl tar files through Docker" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.