I’ve an error, when I try to build a container based on mysql:5.7, my host machine is a Fedora 32.
Docker version 19.03.11, build 42e35e6
docker-compose version 1.25.4, build unknown
My docker-compose.yml
version: '3'
services:
mysql:
container_name: db_mysql
image: mysql:5.7
ports:
- "33062:3306"
environment:
- "MYSQL_ROOT_PASSWORD=123456789"
volumes:
- "./db/mysql/data:/var/lib/mysql"
- "./db/mysql/initdb.d:/docker-entrypoint-initdb.d"
networks:
- backend
networks:
backend:
driver: bridge
When I run the following command, docker-compose exited with code 2
sudo docker-compose up --build --force-recreate
The logs are:
$ sudo docker-compose up --build --force-recreate
Recreating db_mysql ...
WARNING: Service "mysql" is using volume "/var/lib/mysql" from the previous container. Host mapping "/home/patrickacioli/Documents/Development/projects/traderclub/traderclub/app/db/mysql/dataRecreating db_mysql ... done
Attaching to db_mysql
db_mysql | 2020-06-29 02:13:40+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.30-1debian10 started.
db_mysql | 2020-06-29 02:13:40+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_mysql | 2020-06-29 02:13:40+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.30-1debian10 started.
db_mysql | ls: cannot open directory '/docker-entrypoint-initdb.d/': Permission denied
db_mysql exited with code 2
I new with the docker, but I try to learning that. I searching about this error in the last hours, but I can’t find anything about this. I hope do find help here.
Best Regards