Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7072

MariaDB: docker compose will mount /var/lib/mysql but not other volumes

$
0
0

This is my Docker Compose for MariaDB:

mariadb:  container_name: mariadb  image: mariadb:latest  environment:    - MYSQL_DATABASE=homeassistant    - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}    - MYSQL_USER=${MYSQL_USER}    - MYSQL_PASSWORD=${MYSQL_PASSWORD}    - TZ=${TZ}  ports:    - 3306:3306  volumes:    - ./mariadb/mariadb_data:/var/lib/mysql    - ./mariadb/conf.d:/etc/mysql/conf.d  networks:    - home_automation  restart: unless-stopped

/var/lib/mysql will mount correctly, but not /etc/mysql/conf.d, as can be seen here:

jiheffe@Wellington-NUC:~$ docker inspect mariadb --format '{{ json .Mounts }}' | jq[  {"Type": "bind","Source": "/home/jiheffe/docker/mariadb/mariadb_data","Destination": "/var/lib/mysql","Mode": "","RW": true,"Propagation": "rprivate"  }]jiheffe@Wellington-NUC:~$

Also, only /var/lib/mysql shows up in Portainer (Portainer screenshot).

Both folders are present in the host file system:

jiheffe@Wellington-NUC:~/docker$ ls -l ./mariadbtotal 8drwxrwxr-x 2 jiheffe jiheffe         4096 May 27 18:27 conf.ddrwxr-xr-x 6 dnsmasq systemd-journal 4096 May 27 19:31 mariadb_datajiheffe@Wellington-NUC:~/docker$ 

Any idea what is going wrong? I even tried to mount some folder in another place, like /tmp, but to no avail. Only /var/lib/mysql gets mounted.


Viewing all articles
Browse latest Browse all 7072

Trending Articles