title: docker container mariadb volumes
body: <p>I have a MariaDB container, to handle my database. </p>
  
  <p>Here is my problem, I execute : </p>
  
  <pre><code>docker-compose exec mariadb mysql -u root 
  </code></pre>
  
  <p>to enter MariaDB container and create a test database, then exit the container, and shut it down through command : </p>
  
  <pre><code>docker-compose down 
  </code></pre>
  
  <p>After that, I start back all my containers through command </p>
  
  <pre><code>docker-compose up
  </code></pre>
  
  <p>go back inside the MariaDB container to see if the database I added persisted but, I found out it did not. I thought I had correctly parameterized MariaDB volumes through this line in my docker-compose : </p>
  
  <pre><code>- '/bitnami/mariadb/:/var/lib/mysql'
  </code></pre>
  
  <p>Here is my complete docker-compose.yml file : </p>
  
  <pre><code>version: '2'
  services:
   myapp:
    image: 'bitnami/symfony:1'
    ports:
      - '8000:8000'
    volumes:
      - '.:/app'
    environment:
      - SYMFONY_PROJECT_NAME=backend
      - MARIADB_HOST=mariadb
      - MARIADB_PORT_NUMBER=3306
      - MARIADB_USER=monty
      - MARIADB_PASSWORD=monty
      - MARIADB_DATABASE=test
    container_name: symfony_container
    depends_on:
      - mariadb
  mariadb:
    image: 'bitnami/mariadb:10.3'
    ports:
      - '3306:3306'
    volumes:
      - '/bitnami/mariadb/:/var/lib/mysql'
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_DATABASE=test
      - MARIADB_PORT_NUMBER=3306
      - MARIADB_ROOT_USER=root
      - MARIADB_USER=monty
      - MARIADB_PASSWORD=monty
    container_name: mariadb
  </code></pre>
  
  <p>If anyone have any leads for me I'll be greatfull.</p>