简体   繁体   中英

How can I stop the docker engine running integrated on WSL2 from the command line?

I run WSL2 on Windows with an Ubuntu distribution inside WSL, and Docker desktop using the integrated "WSL2-based engine".

If I do wsl --shutdown in the CLI, Docker Desktop complains about the backend shutting down unexpectedly.

What command should I issue before the wsl --shutdown to shutdown the Docker engine without danger of loosing data?

What command should I issue before the wsl --shutdown to shutdown the Docker engine without danger of loosing data?

I'm not sure about a "command" (which would be nice, since I prefer keyboard interaction over the mouse for most things), but at the moment I'm just using the GUI. To make sure that Docker Desktop is safely shut down, I go to the Windows Taskbar icon (usually in "Hidden Icons"/overflow, unless you've configured it otherwise), right-click, and Quit Docker Desktop .

There may be a way to script it. I did try taskkill (without) the /f (force) option, but that didn't work.

It sounds like rmlogotest.exe , which is a tool for sending Windows shutdown messages to applications might work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM