V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
salamanderMH
V2EX  ›  Docker

win 上的 docker 问题多多呀

  •  
  •   salamanderMH · 2018-06-13 11:41:51 +08:00 · 2783 次点击
    这是一个创建于 2137 天前的主题,其中的信息可能已经有所发展或是发生改变。

    就写了一个简单的 mysql 服务

    docker-compose.yml

    version: '3'
    services:
      mysql:
        image: mysql:5.7
        volumes:
          - ./mysql/data:/var/lib/mysql
          - ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
        ports: 
          - 3306:3306
        environment:
          - MYSQL_ROOT_PASSWORD=STi7hXedIfgdjxnRgJ
    

    但是当前目录的 my.cnf 读取不进去,好奇怪,前段时间这样的配置都是可以的
    我在 linux 上试了试,是可以的( my.cnf 中我把端口改成了 3307 ) Linux 上:

    Win 上

    PS:Share 磁盘也弄了

    my.cnf

    [mysqld]
    port=3307
    explicit_defaults_for_timestamp=1
    max_allowed_packet = 20M
    innodb_buffer_pool_size=200M
    server-id=344
    
    4 条回复    2018-06-13 14:00:35 +08:00
    Reficul
        1
    Reficul  
       2018-06-13 12:26:52 +08:00 via Android
    可能因为 win 的 docker 是跑在虚拟机里的原因
    xgfan
        2
    xgfan  
       2018-06-13 12:36:19 +08:00
    我记忆中的 Windows Docker 挂载的 Volume 是有问题了,很多数据库都不能正常运行。
    Windows 上开发多了你就会发现,很多玩意儿都是半成品
    比如 Hyper-V Docker
    比如 WSL
    比如那一堆 Conemu 之类的 Shell
    salamanderMH
        3
    salamanderMH  
    OP
       2018-06-13 12:45:36 +08:00
    @xgfan 是的,不过之前我 docker 用的还是挺好的,这次我看了看,我没把 C 盘共享的缘故
    ![]( https://sfault-image.b0.upaiyun.com/220/448/2204483842-5b20a120e79cf_articlex)
    ![]( https://sfault-image.b0.upaiyun.com/169/698/1696981375-5b20a14a42152_articlex)

    估计 C 盘也要用到很多东西的缘故
    boris1993
        4
    boris1993  
       2018-06-13 14:00:35 +08:00 via Android
    能否考虑换用 Linux ?
    通常来说这些工具我根本不考虑装在 Windows 上.......都会用跑 Linux 的二奶机或者虚拟机
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3082 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 00:13 · PVG 08:13 · LAX 17:13 · JFK 20:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.