version: '3.7'
services:
db:
image: mariadb
volumes:
- ./data:/var/lib/mysql
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: ttdb
MYSQL_USER: ttdb
MYSQL_PASSWORD: ttdb
adminer:
image: adminer
restart: on-failure
ports:
- 8081:8080
The above is compose.yml file . After docker-compose -f compose.yml up , everything runs fine .
But the ownership of local folder ./data is as follows:
drwxrwxr-x. 5 systemd-bus-proxy user424 4.0K Jul 25 18:44 data
this is for centos7
drwxrwxr-x 5 999 glb-ban-420 ? 4096 Aug 1 14:13 data
this is for ubuntu 16.04
I am using Centos7 and ubuntu 16.04 .is there any options to change ownership in compose file for locally mounted directories?