[英]WSL2 Ubuntu 20.04 no output for Docker container
I'm on WSL2 Ubuntu 20.04, trying to run a Docker container in "interactive tty" mode, and I simply can't see the output of the container in the terminal.我在 WSL2 Ubuntu 20.04 上,试图在“交互式 tty”模式下运行 Docker 容器,我根本看不到终端中的 Z78E6221F6393D1356681DBCE39 容器。
$ docker run --rm -it alpine:3.12 # in container $ ls # hit enter, can't see anything
I was able to overcome it with ttyd , but I prefer using my terminal, any leads on this one?我能够用ttyd克服它,但我更喜欢使用我的终端,这个有什么线索吗?
PS C:\WINDOWS\system32> wsl --list --verbose NAME STATE VERSION * Ubuntu-20.04 Running 2 docker-desktop-data Running 2 docker-desktop Running 2
Enable integration with my default WSL distro
and Ubuntu-20.04
. Docker for Desktop > Settings > Resources > WSL Integration > 选中Enable integration with my default WSL distro
和Ubuntu-20.04
。 I also unchecked, Applied & Restarted > Same results我也未选中,应用并重新启动>相同的结果wsl --shutdown
> Same results PowerShell 以管理员身份 > wsl --shutdown
> 结果相同 $ docker run -it --rm unfor19/catfact:1.0 sh Cat fact: The first cartoon cat was Felix the Cat in 1919. In 1940, Tom and Jerry starred in the first theatrical cartoon “Puss Gets the Boot.” In 1981 Andrew Lloyd Weber created the musical Cats, based on TS Eliot's Old Possum's Book of Practical Cats
I guess it's related to the fact my $PATH
variable was changed in my ~/.bashrc
file.我想这与我的$PATH
变量在我的~/.bashrc
文件中更改的事实有关。
I was able to fix it by following the instructions in我能够按照中的说明进行修复
Adding the following line to my ~/.bashrc
followed by wsl --shutdown
fixed it将以下行添加到我的~/.bashrc
后跟wsl --shutdown
修复它
# Support Windows commands
export PATH="${PATH}:/mnt/c/Windows/system32"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.