【问题标题】:mingw in docker container no outputdocker容器中的mingw没有输出
【发布时间】:2017-06-27 07:00:57
【问题描述】:

我显然做错了什么。或者有一个错误。无论如何,在最近的 docker 17.03.1-ce 上,运行各种 windows 容器,例如:

docker run -it microsoft/windowsservercore

并没有看到 mingw 和 cygwin 工具的输出:

C:\test>dir
 Volume in drive C has no label.
 Volume Serial Number is 0E7C-C210

 Directory of C:\test

06/27/2017  08:43 AM    <DIR>          .
06/27/2017  08:43 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  20,098,813,952 bytes free

C:\test>bash

C:\test>bash -c 'mkdir aa'

C:\test>ls

C:\test>dir
 Volume in drive C has no label.
 Volume Serial Number is 0E7C-C210

 Directory of C:\test

06/27/2017  08:44 AM    <DIR>          .
06/27/2017  08:44 AM    <DIR>          ..
06/27/2017  08:44 AM    <DIR>          aa
               0 File(s)              0 bytes
               3 Dir(s)  20,098,813,952 bytes free

C:\test>bash -c -v -x 'mkdir aa'

C:\test>echo %errorlevel%
1

C:\test>bash -c -v -x 'mkdir aa' 2>a.txt

C:\test>dir
 Volume in drive C has no label.
 Volume Serial Number is 0E7C-C210

 Directory of C:\test

06/27/2017  08:51 AM    <DIR>          .
06/27/2017  08:51 AM    <DIR>          ..
06/27/2017  08:51 AM                69 a.txt
06/27/2017  08:44 AM    <DIR>          aa
               1 File(s)             69 bytes
               3 Dir(s)  20,098,813,952 bytes free

C:\test>type a.txt
mkdir aa
+ mkdir aa
mkdir: cannot create directory 'aa': File exists

Docker 日志似乎没有任何错误或警告。

到目前为止,我也尝试过: - 用巧克力安装 git - 直接从 zip froom github 安装 git - 使用巧克力安装 msys2 并从那里使用 bash - 用巧克力安装 cygwin 并从那里使用 bash - 在不同的主机和容器终端 cmd.exe powershell.exe far.exe 中尝试相同 - 问题仍然相同

相同的工具在主机上正常工作,它们在容器内工作,只是输出丢失。

任何提示我可以尝试什么?

【问题讨论】:

    标签: windows docker terminal containers


    【解决方案1】:

    好的,它看起来像 known issue,不知道为什么我之前找不到它。

    因此,(某种)解决方法将使用不带 -t 标志的容器

    【讨论】:

      猜你喜欢
      • 2018-05-29
      • 2020-01-26
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 2021-08-08
      • 2015-12-09
      • 1970-01-01
      相关资源
      最近更新 更多