I am receiving 'no such file or directory' when I start mysql even though the file exists in the correct directory.
thescript:
#!/bin/bash
/usr/bin/docker exec -i mysql /bin/bash <<EOF
mysql -uroot -ppasswd
CREATE DATABASE theDB CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES on theDB.* to user@'%' IDENTIFIED BY 'passwd';
FLUSH PRIVILEGES;
EOF
docker.yml:
version: "2"
services:
mysql:
image: mysql:latest
restart: always
container_name: mysql
environment:
- MYSQL_ROOT_PASSWORD=passwd
volumes:
- /temp/mysql_cnf:/etc/mysql/mysql.conf.d
ports:
- 3306:3306
command: /bin/sh -c "chmod +x /home/user/mysql-container/thescript.sh && /bin/sh /home/user/mysql-container/thescript.sh"
~