Search code examples
dockerwindows-subsystem-for-linuxdocker-volume

Docker volume stops getting in sync


I'm using docker on windows with wsl.

I think i set it up correctly because i was working on it successfully for almost 3 months without problems, but yesterday i updated docker to the last version (19.03.5) and now my volumes are not synchronizing the files correctly. I have to do a docker-compose restart for being able to see the files correctly.

On wsl i mounted C: under /c/:

here is my docker-compose.yml:

version: "3"
services:
  php:
    build: ./php
    container_name: php
    depends_on:
      - db
    volumes:
      - ../../WWW:/code
      - /code/treddy/api/vendor
  web:
    image: nginx:latest
    container_name: web
    ports:
      - 80:80
      - 443:443
    volumes:
      - ../../WWW:/code
      - ./nginx.conf:/etc/nginx/nginx.conf
    depends_on:
      - php

  db:
    image: mysql:5.7
    container_name: db
    ports:
      - "3306:3306"
    volumes:
      - ./dbdata:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: password

Sometimes when i restart docker, it seems that all works correctly but after some edits to files the volume stops to sync files.


Solution

  • Downgrade to 2.1.0.5 or try this solution https://github.com/docker/for-win/issues/5530#issuecomment-578228528