I have the same problem like here Docker - failed to mount local volume, no such file or directory
docker-compose --verbose up -d
[+] Running 0/0
- Container brickchart-mysql-1 Creating 0.0s
Error response from daemon: failed to mount local volume: mount
.docker/mysql/data:/var/lib/docker/volumes/brickchart_db_volume/_data,
flags: 0x1000: no such file or directory
Here is my docker-compose.yml file:
version: '3.9'
services:
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: db_name
MYSQL_USER: db_user
MYSQL_PASSWORD: db_password
ports:
- "3306:3306"
volumes:
- db_volume:/var/lib/mysql:delegated
volumes:
db_volume:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: ./.docker/mysql/data
I have the latest Docker Desktop installed:
I also tested older versions: 4.14.0, 4.12.0 and 4.10.1.
I understand that the docker-compose file is converted to docker commands. A verbose flag would help a lot. Unfortunately, it seems like the verbose flag doesn't exist: https://github.com/docker/compose/issues/1640
It would be great if I can see how
volumes:
- db_volume:/var/lib/mysql:delegated
will be converted in to docker commands.
Does anybody have any tips for this problem?