なんでかはよくわからいけど、volumesでリソース?を定義してそれをマウントしようとするとうまくいかなかったので、直接書いたらいけた
Docker for WindowsをWSLで使ってる
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
db: image: mariadb:latest environment: MYSQL_ROOT_PASSWORD: password123 networks: mynet: ipv4_address: 172.21.0.2 volumes: - mysql-vol:/var/lib/mysql volumes: wp-vol: driver_opts: type: none device: /mnt/c/container/Docker/wordpress/volumes/html o: bind mysql-vol: driver_opts: type: none device: /mnt/c/container/Docker/wordpress/volumes/data o: bind |
以下のように変更
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
db: image: mariadb:latest environment: MYSQL_ROOT_PASSWORD: password123 networks: mynet: ipv4_address: 172.21.0.2 volumes: - /mnt/c/container/Docker/wordpress/volumes/data:/var/lib/mysql # volumes: # wp-vol: # driver_opts: # type: none # device: /mnt/c/container/Docker/wordpress/volumes/html # o: bind # mysql-vol: # driver_opts: # type: none # device: /mnt/c/container/Docker/wordpress/volumes/data # o: bind |