In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Environment description
Environment: win10 Enterprise Edition + ubuntu 18.04LTS [WSL]
Win10 install Docker for windows
Now that Docker has a special installation package for Win10 Professional system, you need to open Hyper-V.
Turn on Hyper-V
Programs and functions
Enable or disable the Windows feature
Check Hyper-V
Install Docker for windows
The latest version of Docker for windows
Download address: https://docs.docker.com/v17.09/docker-for-windows/install/
Click Get Docker for Windows [Stable] and download the version of Windows:
When the installation is complete, Docker starts automatically. A small whale icon appears on the notification bar, indicating that Docker is running.
Three icons also appear at the table, as shown in the following figure:
We can execute docker version on the command line to check the version number and docker run hello-world to load the test image test.
If it doesn't start, you can search Docker on Windows to start it:
After startup, you can also see the little whale icon on the notification bar:
Subsystem installation Docker installation
No problem
Leenhem@DESKTOP-7SREO20:~$ sudo apt-get install docker.ioReading package lists... DoneBuilding dependency treeReading state information... Donedocker.io is already the newest version (18.09.7-0ubuntu1~18.04.4). 0 upgraded, 0 newly installed, 0 to remove and 111not upgraded.
There is a problem with its use [cannot be used properly]
Explain the doubt on the official website
Leenhem@DESKTOP-7SREO20:~$ docker psCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?leenhem@DESKTOP-7SREO20:~$ sudo / etc/init.d/docker status * Docker is not runningleenhem@DESKTOP-7SREO20:~$ sudo / etc/init.d/docker start * Starting Docker: docker [OK] leenhem@DESKTOP-7SREO20:~$ leenhem@DESKTOP-7SREO20:~$ sudo / etc/init.d/docker status * Docker is runningleenhem@DESKTOP-7SREO20:~$ sudo / etc/init.d/docker status * Docker Is not running, you'll find that this Docker won't start at all. So what do we do now? Be sure to read the log (/ var/log/docker.log) leenhem@DESKTOP-7SREO20:~$ tail / var/log/docker.log-n 100time = "20119-10-22T11:58:25.436968100+08:00" level=info msg= "ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0}]" module=grpctime= "20119-10-22T11:58:25.437359900+08:00" level=info msg= "ClientConn switching balancer to\" pick_first\ "module=grpctime=" 2019- 10-22T11:58:25.437703900+08:00 "level=info msg=" pickfirstBalancer: HandleSubConnStateChange: 0xc420769030 CONNECTING "module=grpctime=" 2019-10-22T11:58:25.438698400+08:00 "level=info msg=" pickfirstBalancer: HandleSubConnStateChange: 0xc420769030 READY "module=grpctime=" 2019-10-22T11:58:25.559058900+08:00 "level=info msg=" [graphdriver] using prior storage driver: overlay2 "time=" 2019-10-22T11:58:25.719182400+08:00 "level=info msg=" Graph migration to content-addressability took 0.00 seconds "time=" 2019-10-22T11:58:25.719593400+08:00 "level=warning msg=" Your kernel does not support cgroup memory limit "time=" 2019-10-22T11:58:25.719660300+08:00 "level=warning msg=" Unable to find cpu cgroup in mounts "time=" 2019 -10-22T11:58:25.719697200+08:00 "level=warning msg=" Unable to find blkio cgroup in mounts "time=" 2019-10-22T11:58:25.719732900+08:00 "level=warning msg=" Unable to find cpuset cgroup in mounts "time=" 2019-10-22T11:58:25.719888000+08:00 "level=warning msg=" mountpoint for pids not found "time=" 2019-10-22T11:58:25.721991900+08:00 "level=info msg=" stopping healthcheck following graceful shutdown "module=libcontainerdtime=" 2019-10-22T11:58:25.722045300+08:00 "level=info msg=" Stopping event stream following graceful shutdown "error=" context canceled "module=libcontainerd namespace=plugins.mobytime=" 2019-10-22T11:58:25.723869300+08:00 "level=info msg=" pickfirstBalancer: HandleSubConnStateChange: 0xc420769030 TRANSIENT_FAILURE "module=grpctime=" 2019-10-22T11:58:25.724042800+08:00 "level=info msg=" pickfirstBalancer: HandleSubConnStateChange: 0xc420769030, CONNECTING "module=grpcError starting daemon: Devices cgroup isn't mounted preliminary conclusion: the WIN10 kernel should not be able to fully simulate the cgroup and aufs components of Linux
Official website explanation [solution]
[Cross Post] WSL Interoperability with Docker
Https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly
Apt install screenfetchscreenfetch script: https://files.cnblogs.com/files/rgqancy/WSL.js, download and save as txt
Establish a relay
Now that we have Go installed, we can build relays. In the following command, be sure to replace it with your Windows username:
Go get-d github.com/jstarks/npiperelayGOOS=windows go build-o / mnt/c/Users/Administrator/go/bin/npiperelay.exe github.com/jstarks/npiperelay
We have now built a relay for Windows, but we want it to be called from within WSL. To do this, we create a symbolic link. Be sure to replace with your Windows user name:
Sudo ln-s / mnt/c/Users/Administrator/go/bin/npiperelay.exe / usr/local/bin/npiperelay.exe
We will use socat to help enable trunking. Install socat, a tool that allows two-way flow of data between two points (described in more detail later). Grab this package:
Sudo apt install socat
Last step
With the installation of socat and the construction of executables, we only need to string a few things together. We will make a shell script to activate our function. We will put it in the user's home directory. To do this:
# make the filetouch ~ / docker-relay#add execution privilegeschmod + x ~ / docker-relay
Open the file we created with your favorite text editor (such as vim). Paste it into the file docker-relay:
#! / bin/shexec socat UNIX-LISTEN:/var/run/docker.sock,fork,group=docker,umask=007 EXEC: "npiperelay.exe-ep-s / /. / pipe/docker_engine", nofork
Save the file and close it. The docker-relay script configures the Docker pipe to allow docker group access. To run as a normal user (you don't have to append 'sudo' to each docker command), add your WSL users to the docker group. In Ubuntu:
Sudo adduser docker
Let's test it!
Open a new WSL shell to ensure that your group membership is reset. Start the relay in the background:
Sudo ~ / docker-relay &
Now run the docker command to test the waters. You should be greeted with the same output, just as you run the command from Windows (and note that you don't need to add'sudo 'before the command! )
Be careful
To start docker for windows ahead of time
Schematic diagram
There is a basic problem with making Docker clients run under WSL to communicate with Docker for Windows: WSL clients understand IPC through unix sockets, while Docker for Windows understands IPC through named pipes. This is where socat and npiperelay.exe come into play-this is the intermediary between these two disjoint forms of IPC. Socat understands how to communicate through unix sockets, and npiperelay understands how to communicate through named pipes. Both Socat and npiperelay know how to communicate through stdio, so they can communicate with each other.
Summary
The above is the tutorial of installing Docker in Win10 subsystem ubuntu (WSL) introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
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.