My command:
docker run -v `pwd`/conf-mysql:/etc/mysql/conf.d -v `pwd`/volume-mysql:/var/lib/db-data -e MYSQL_ROOT_PASSWORD=my-secret-pw mysql
My custom config
$ cat conf-mysql/my.cnf
[mysqld]
datadir=/var/lib/db-data/
Then I expect data in volume-mysql but it's empty
In mysql:5.6 works fine
$ docker -v
Docker version 17.03.0-ce, build 60ccb22
Are there any files in volume-mysql? 5.7 is more restrictive when creating its database, and will in general report an error if datadir isn't empty (exceptions are files beginning with a . or anything specified with --ignore-db-dir)
Ah, I see the issue (and tested). We say to map /etc/mysql/conf.d for custom config, but this directory is included before /etc/mysql/mysqld.conf.d which in 5.7 contains the actual default server config (in 5.6 this is in /etc/mysql/my.cnf
For 5.7 the documented way doesn't work for overriding options present in the default config file, so we'll need to look at that.
Mapping your config to /etc/mysql/mysql.conf.d/ instead of .../conf.d/ should fix your issue for 5.7 (but then it won't work for 5.6)
It would be good to add this to doc for mitigate the issue.
Thanks
None of the include locations suggested worked for me:
The only thing that works is actually modifying the CMD on docker run and pushing in the includedir:
docker run -d \
--volume /my/custom/conf.d:/etc/mysql/conf.d \
mysql/mysql-server:5.7 \
sh -c "
echo '!includedir /etc/mysql/conf.d/' >> /etc/my.cnf
mysqld
"
Note that restarting the docker will push in the directive each time. I tend to remove the container for each run. It's a temp solution anyway.
@joyarzun any particular reason not to just use --datadir=/var/lib/db-data instead of creating a whole custom config file for it?
$ docker run -it --rm -v /var/lib/db-data -e MYSQL_ROOT_PASSWORD=example mysql:5.7 --datadir=/var/lib/db-data
Initializing database
2017-12-26T23:54:37.740800Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-12-26T23:54:38.086463Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-12-26T23:54:38.156060Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-12-26T23:54:38.218854Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 21dd96e8-ea98-11e7-960e-0242ac120013.
2017-12-26T23:54:38.220737Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-12-26T23:54:38.222007Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2017-12-26T23:54:38.926709Z 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:38.926728Z 1 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:38.926736Z 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:38.926745Z 1 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:38.926748Z 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:38.926755Z 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:38.926771Z 1 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:38.926776Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
Database initialized
Initializing certificates
Generating a 2048 bit RSA private key
..................................................................................+++
.....................................................+++
unable to write 'random state'
writing new private key to 'ca-key.pem'
-----
Generating a 2048 bit RSA private key
............+++
..........................+++
unable to write 'random state'
writing new private key to 'server-key.pem'
-----
Generating a 2048 bit RSA private key
................................+++
.......................................+++
unable to write 'random state'
writing new private key to 'client-key.pem'
-----
Certificates initialized
MySQL init process in progress...
2017-12-26T23:54:41.140160Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-12-26T23:54:41.140754Z 0 [Note] mysqld (mysqld 5.7.20) starting as process 91 ...
2017-12-26T23:54:41.142360Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-12-26T23:54:41.142370Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-26T23:54:41.142373Z 0 [Note] InnoDB: Uses event mutexes
2017-12-26T23:54:41.142375Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-12-26T23:54:41.142377Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-26T23:54:41.142379Z 0 [Note] InnoDB: Using Linux native AIO
2017-12-26T23:54:41.142504Z 0 [Note] InnoDB: Number of pools: 1
2017-12-26T23:54:41.142592Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-12-26T23:54:41.143368Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-12-26T23:54:41.146849Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-12-26T23:54:41.147799Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-12-26T23:54:41.158675Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-12-26T23:54:41.162964Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-12-26T23:54:41.162995Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-12-26T23:54:41.189121Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-12-26T23:54:41.189713Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-12-26T23:54:41.189720Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-12-26T23:54:41.190095Z 0 [Note] InnoDB: 5.7.20 started; log sequence number 2565377
2017-12-26T23:54:41.190376Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/db-data/ib_buffer_pool
2017-12-26T23:54:41.190446Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-12-26T23:54:41.190993Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171226 23:54:41
2017-12-26T23:54:41.192180Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2017-12-26T23:54:41.192276Z 0 [Warning] CA certificate ca.pem is self signed.
2017-12-26T23:54:41.194813Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.194826Z 0 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.194830Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.194836Z 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.194838Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.194842Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.195481Z 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.195489Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:41.197875Z 0 [Note] Event Scheduler: Loaded 0 events
2017-12-26T23:54:41.198007Z 0 [Note] mysqld: ready for connections.
Version: '5.7.20' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2017-12-26T23:54:41.198015Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
2017-12-26T23:54:41.198016Z 0 [Note] Beginning of list of non-natively partitioned tables
2017-12-26T23:54:41.202220Z 0 [Note] End of list of non-natively partitioned tables
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
2017-12-26T23:54:42.969337Z 5 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.969351Z 5 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.969355Z 5 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.969363Z 5 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.969365Z 5 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.969369Z 5 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.969383Z 5 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.969389Z 5 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:42.970295Z 0 [Note] Giving 0 client threads a chance to die gracefully
2017-12-26T23:54:42.970302Z 0 [Note] Shutting down slave threads
2017-12-26T23:54:42.970304Z 0 [Note] Forcefully disconnecting 0 remaining clients
2017-12-26T23:54:42.970308Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2017-12-26T23:54:42.970561Z 0 [Note] Binlog end
2017-12-26T23:54:42.970925Z 0 [Note] Shutting down plugin 'ngram'
2017-12-26T23:54:42.970929Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-12-26T23:54:42.970932Z 0 [Note] Shutting down plugin 'partition'
2017-12-26T23:54:42.970950Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-12-26T23:54:42.970952Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2017-12-26T23:54:42.970954Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-12-26T23:54:42.970956Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-12-26T23:54:42.970957Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-12-26T23:54:42.970959Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-12-26T23:54:42.970961Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-12-26T23:54:42.970962Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-12-26T23:54:42.970964Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-12-26T23:54:42.970966Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-12-26T23:54:42.970967Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-12-26T23:54:42.970969Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-12-26T23:54:42.970970Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-12-26T23:54:42.970972Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-12-26T23:54:42.970973Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-12-26T23:54:42.970974Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-12-26T23:54:42.970976Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-12-26T23:54:42.970977Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2017-12-26T23:54:42.970979Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2017-12-26T23:54:42.970981Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-12-26T23:54:42.970982Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-12-26T23:54:42.970984Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-12-26T23:54:42.970985Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-12-26T23:54:42.970987Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-12-26T23:54:42.970988Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-12-26T23:54:42.970990Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-12-26T23:54:42.970992Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-12-26T23:54:42.970993Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2017-12-26T23:54:42.970995Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-12-26T23:54:42.970996Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-12-26T23:54:42.970998Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2017-12-26T23:54:42.971000Z 0 [Note] Shutting down plugin 'InnoDB'
2017-12-26T23:54:42.971034Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-12-26T23:54:42.971061Z 0 [Note] InnoDB: Starting shutdown...
2017-12-26T23:54:43.071340Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/db-data/ib_buffer_pool
2017-12-26T23:54:43.072055Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 171226 23:54:43
2017-12-26T23:54:44.180296Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12156659
2017-12-26T23:54:44.181383Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2017-12-26T23:54:44.181390Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-12-26T23:54:44.181409Z 0 [Note] Shutting down plugin 'MyISAM'
2017-12-26T23:54:44.181415Z 0 [Note] Shutting down plugin 'CSV'
2017-12-26T23:54:44.181418Z 0 [Note] Shutting down plugin 'MEMORY'
2017-12-26T23:54:44.181421Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-12-26T23:54:44.181433Z 0 [Note] Shutting down plugin 'sha256_password'
2017-12-26T23:54:44.181435Z 0 [Note] Shutting down plugin 'mysql_native_password'
2017-12-26T23:54:44.181552Z 0 [Note] Shutting down plugin 'binlog'
2017-12-26T23:54:44.181914Z 0 [Note] mysqld: Shutdown complete
MySQL init process done. Ready for start up.
2017-12-26T23:54:44.392677Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-12-26T23:54:44.393389Z 0 [Note] mysqld (mysqld 5.7.20) starting as process 1 ...
2017-12-26T23:54:44.394980Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-12-26T23:54:44.394994Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-26T23:54:44.394998Z 0 [Note] InnoDB: Uses event mutexes
2017-12-26T23:54:44.395000Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-12-26T23:54:44.395004Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-26T23:54:44.395006Z 0 [Note] InnoDB: Using Linux native AIO
2017-12-26T23:54:44.395112Z 0 [Note] InnoDB: Number of pools: 1
2017-12-26T23:54:44.395160Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-12-26T23:54:44.396021Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-12-26T23:54:44.399495Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-12-26T23:54:44.400358Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-12-26T23:54:44.411310Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-12-26T23:54:44.415556Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-12-26T23:54:44.415585Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-12-26T23:54:44.441599Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-12-26T23:54:44.442082Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-12-26T23:54:44.442089Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-12-26T23:54:44.442540Z 0 [Note] InnoDB: 5.7.20 started; log sequence number 12156659
2017-12-26T23:54:44.442632Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/db-data/ib_buffer_pool
2017-12-26T23:54:44.442768Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-12-26T23:54:44.444106Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171226 23:54:44
2017-12-26T23:54:44.444583Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2017-12-26T23:54:44.444726Z 0 [Warning] CA certificate ca.pem is self signed.
2017-12-26T23:54:44.445607Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-12-26T23:54:44.445625Z 0 [Note] IPv6 is available.
2017-12-26T23:54:44.445629Z 0 [Note] - '::' resolves to '::';
2017-12-26T23:54:44.445636Z 0 [Note] Server socket created on IP: '::'.
2017-12-26T23:54:44.447554Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.447569Z 0 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.447575Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.447596Z 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.447601Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.447607Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.448511Z 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.448519Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-12-26T23:54:44.450725Z 0 [Note] Event Scheduler: Loaded 0 events
2017-12-26T23:54:44.450871Z 0 [Note] mysqld: ready for connections.
Version: '5.7.20' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2017-12-26T23:54:44.450879Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
2017-12-26T23:54:44.450882Z 0 [Note] Beginning of list of non-natively partitioned tables
2017-12-26T23:54:44.455228Z 0 [Note] End of list of non-natively partitioned tables
@tianon I have no reason to use a custom config, but this should don't mean that the documented way is correct. In fact, it's incorrect or at least lacks information. Like I said, this issue could be mitigated adding more info to docs. Anyway thanks :)
PS: English is not my principal lang
The documented way is correct, but for certain options it's necessary to use a different directory due to the default configuration.
It would probably be more helpful for us to update the documentation to instead show folks how to find the default configuration than to talk directly about /etc/mysql/conf.d, something like:
$ docker run -it --rm mysql:5.7 bash
root@bef7c562becd:/# cat /etc/mysql/my.cnf
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
So, my suggestion would be updating the existing section to say something like:
The default configuration for MySQL can be found in
/etc/mysql/my.cnf, which may!includediradditional directories such as/etc/mysql/conf.dor/etc/mysql/mysql.conf.d. Please inspect the relevant files and directories within the image itself for more details.
Finally opened a PR for my suggested wording: https://github.com/docker-library/docs/pull/1202
Most helpful comment
Ah, I see the issue (and tested). We say to map /etc/mysql/conf.d for custom config, but this directory is included before /etc/mysql/mysqld.conf.d which in 5.7 contains the actual default server config (in 5.6 this is in /etc/mysql/my.cnf
For 5.7 the documented way doesn't work for overriding options present in the default config file, so we'll need to look at that.
Mapping your config to /etc/mysql/mysql.conf.d/ instead of .../conf.d/ should fix your issue for 5.7 (but then it won't work for 5.6)