salamanderMH
V2EX  ›  Docker

win 上的 docker 问题多多呀

  •  
  •   salamanderMH · Jun 13, 2018 · 3408 views
    This topic created in 2970 days ago, the information mentioned may be changed or developed.

    就写了一个简单的 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 replies    2018-06-13 14:00:35 +08:00
    Reficul
        1
    Reficul  
       Jun 13, 2018 via Android
    可能因为 win 的 docker 是跑在虚拟机里的原因
    6IbA2bj5ip3tK49j
        2
    6IbA2bj5ip3tK49j  
       Jun 13, 2018
    我记忆中的 Windows Docker 挂载的 Volume 是有问题了,很多数据库都不能正常运行。
    Windows 上开发多了你就会发现,很多玩意儿都是半成品
    比如 Hyper-V Docker
    比如 WSL
    比如那一堆 Conemu 之类的 Shell
    salamanderMH
        3
    salamanderMH  
    OP
       Jun 13, 2018
    @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  
       Jun 13, 2018 via Android
    能否考虑换用 Linux ?
    通常来说这些工具我根本不考虑装在 Windows 上.......都会用跑 Linux 的二奶机或者虚拟机
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2760 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:33 · PVG 21:33 · LAX 06:33 · JFK 09:33
    ♥ Do have faith in what you're doing.