title: Docker. MySQL image. Can't change my.cnf file
body: <p>I have such a <code>docker-compose.yml</code>:</p>
  
  <pre><code>    database:
          container_name: test_db
          image: mysql:5.7
          volumes:
              - ./docker/my.cnf:/etc/my.cnf
          environment:
              - "MYSQL_ROOT_PASSWORD=root"
              - "MYSQL_DATABASE=test_db"
          ports:
              - "3306:3306"
          volumes:
            - test_db_data:/var/lib/mysql
  
  volumes:
      test_db_data:
  </code></pre>
  
  <p>and I want to edit the <code>sql_mode</code>.</p>
  
  <p><code>./docker/my.cnf</code> contains:</p>
  
  <pre><code>[mysqld]
  sql_mode=""
  </code></pre>
  
  <p>But when I connect to db from my local machine and run <code>SELECT @@sql_mode;</code> I receive:</p>
  
  <pre><code>ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  </code></pre>
  
  <p>What am I doing wrong?</p>