I am experiencing a problem with docker-compose, its mounting a volume in a folder on a mounted hard drive. I have seen lots of solutions out there and honestly tried them all.
I changed the permissions to the user that I am using, to root, to docker, within their respective groups. Nothing
Writing operations work fine, I can write a file through python I am not restricted, but when I run docker compose to make an sql db it gives me this:
ERROR: for mysql_db Cannot start service mysql_db: error while creating mount source path '/db-path-mount': chown /db-path-mount/db-volume-folder/db-one: operation not permitted
ERROR: for mysql_db Cannot start service mysql_db: error while creating mount source path '/db-path-mount': chown /db-path-mount/db-volume-folder/db-one: operation not permitted ERROR: Encountered errors while bringing up the project.
Out there seems that the troubleshooting is scarce, I tried docker-compose up -d and sudo docker-compose up -d, nothing really changes.
drwxr-xr-x 3 myUser docker 4028276 Jul 26 04:47 db-volume-folder/
and my mount point (etc/fstab):
UUID=MY_UUID /home/user/my_mount_point auto uid=1001,gid=122,umask=022,defaults 0 1
(gid=122 is docker)
(uid=1001 is user)
I am using ubuntu 20 server
docker-compose.yml:
version: "3.7"
services:
my_sql_db:
container_name: my_sql_db
user: root
image: mysql/mysql-server:latest
ports:
- "1533:3306"
env_file:
- secrets/sqlserver.env
- secrets/sqlpassword.env
volumes:
- ./db-path-mount/db-volume-folder/db-one:/var/lib/mysql