zander
V2EX  ›  Docker

Windows Server 上跑 Docker,是使用 Hyper-V 装 ubuntu 还是装 Docker for Windows?

  •  
  •   zander · Jun 19, 2019 · 6265 views
    This topic created in 2544 days ago, the information mentioned may be changed or developed.

    有台 windows server,上面已经跑了一些 hyper-v windows 了,改装 ubuntu 是不可能的。 如果要用 docker 跑几个轻一点的应用的话,是用 hyper-v 装 ubuntu 跑 docker,还是装个 docker for windows 呢?

    3 replies    2019-06-19 16:25:23 +08:00
    whatsmyip
        1
    whatsmyip  
       Jun 19, 2019
    docker for widows 好多命令不支持吧
    zpf124
        2
    zpf124  
       Jun 19, 2019
    @whatsmyip 比如?

    有 hyper-v 的话,直接装 docker 就 ok 了, 我目前的使用是并没有什么问题.

    唯一一点可能会出现问题的是, build 命令, 你拷文件的指令他会提示 warring, 说因为文件权限不一致,所以镜像内文件可能没有权限,你需要手动处理.

    再来还有一个不算是 docker for win 的问题, dockerfile 文件是必须 LF 换行才行的, 之前一次因为 windows 安装的 git 默认会在 pull 和 push 的时候将换行符进行转换 导致我 clone 下来的 dockerfile 文件换行符都变成 CRLF 了, 然后 build 的时候 就提示非法字符了.
    whwlsfb
        3
    whwlsfb  
       Jun 19, 2019
    docker for windows 比较轻量,有相应的 toolkit 用起来也比较方便,但是在文件映射之后的权限方面会有些坑。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   893 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 22:13 · PVG 06:13 · LAX 15:13 · JFK 18:13
    ♥ Do have faith in what you're doing.