title: docker-compose how to link an exist mariadb rather than create a new one
body: <p>The application compose file is:</p>
  
  <pre><code>version: '2'
  
      services:
        db:
          image: mariadb:10.1
          environment:
            MYSQL_ROOT_PASSWORD: filerun
            MYSQL_USER: filerun
            MYSQL_PASSWORD: filerun
            MYSQL_DATABASE: filerun
          volumes:
            - /filerun/db:/var/lib/mysql
  
        web:
          depends_on:
            - db
          links:
            - db
          image: afian/filerun
          ports:
            - "80:80"
          volumes:
            - /filerun/html:/var/www/html
            - /filerun/user-files:/user-files
  </code></pre>
  
  <p>it seems like a new mariadb(web_db_1) will be created, but How to use an already exists mariadb run with <code>docker run --name mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=passwordhere -d mariadb:latest</code></p>