Docker机密不适用于MYSQL_ROOT_PASSWORD_FILE

时间:2017-06-29 15:23:38

标签: docker docker-compose dockerfile docker-swarm

我正在学习有关用于存储我的灯泡容器堆栈的mysql密码的docker机密信息。我正在为Windows 17.06.0-ce-win18(12627)运行docker。

我按照以下步骤操作:

1 - 在docker中创建秘密,如下所示:

echo password | docker secret create mysql_db_root -

2 - 创建了如下所示的撰写文件:

version: "3.1"
services:
  apachephp:
    image: apachephp
    deploy:
     replicas: 1
#     restart_policy:
 #      condition: on-failure
     resources:
       limits:
         cpus: "0.1"
         memory: 50M
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - C:\Users\Daniel\Desktop\Learning\DockerStuff\phpdev\www:/var/www/html
    networks:
      - webnet
  db:
    image: mysql:latest
    ports:
      - "3306:3306"
    volumes:
      - C:\Users\Daniel\Desktop\Learning\DockerStuff\phpdev\db:/var/lib/mysql
    secrets:
      - mysql_db_root
    environment:
       MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_db_root
       #MYSQL_ROOT_PASSWORD: "password"
    networks:
      - webnet
  adminer:
    image: adminer
    ports:
        - 8080:8080
    networks:
      - webnet
secrets:
  mysql_db_root:
    external: true
networks:
  webnet:

3 - 检查以确保mysql容器中有秘密可用

C:\Learning\DockerStuff\phpdev>docker exec -it 452 bash
root@45278a63bc6b:/# cat /run/secrets/mysql_db_root
password

4 - 所以密码可用,现在尝试登录mysql:

root@45278a63bc6b:/# mysql
root@45278a63bc6b:/# mysql -u root -p -h localhost
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

密码"密码"不起作用! anyonoe可以对此有所了解吗?提前谢谢!

mysql容器日志如下:

lampstack_db.1.wgofhqdl1v33@moby    | Initializing database
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:16.743604Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:17.468430Z 0 [Warning] InnoDB: New log files created, LSN=45790
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:17.563991Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:17.574436Z 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: 207c7b19-5cda-11e7-854a-02420aff0004.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:17.578567Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:17.584520Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:20.354931Z 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:20.354971Z 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:20.354980Z 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:20.354987Z 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:20.355007Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | Database initialized
lampstack_db.1.wgofhqdl1v33@moby    | Initializing certificates
lampstack_db.1.wgofhqdl1v33@moby    | Generating a 2048 bit RSA private key
lampstack_db.1.wgofhqdl1v33@moby    | ..............................................................................................+++
lampstack_db.1.wgofhqdl1v33@moby    | ...............+++
lampstack_db.1.wgofhqdl1v33@moby    | unable to write 'random state'
lampstack_db.1.wgofhqdl1v33@moby    | writing new private key to 'ca-key.pem'
lampstack_db.1.wgofhqdl1v33@moby    | -----
lampstack_db.1.wgofhqdl1v33@moby    | Generating a 2048 bit RSA private key
lampstack_db.1.wgofhqdl1v33@moby    | ..............................+++
lampstack_db.1.wgofhqdl1v33@moby    | ..+++
lampstack_db.1.wgofhqdl1v33@moby    | unable to write 'random state'
lampstack_db.1.wgofhqdl1v33@moby    | writing new private key to 'server-key.pem'
lampstack_db.1.wgofhqdl1v33@moby    | -----
lampstack_db.1.wgofhqdl1v33@moby    | Generating a 2048 bit RSA private key
lampstack_db.1.wgofhqdl1v33@moby    | ............+++
lampstack_db.1.wgofhqdl1v33@moby    | .............+++
lampstack_db.1.wgofhqdl1v33@moby    | unable to write 'random state'
lampstack_db.1.wgofhqdl1v33@moby    | writing new private key to 'client-key.pem'
lampstack_db.1.wgofhqdl1v33@moby    | -----
lampstack_db.1.wgofhqdl1v33@moby    | Certificates initialized
lampstack_db.1.wgofhqdl1v33@moby    | MySQL init process in progress...
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.668312Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.674228Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 89 ...
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681123Z 0 [Note] InnoDB: PUNCH HOLE support available
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681142Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681145Z 0 [Note] InnoDB: Uses event mutexes
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681147Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681149Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681151Z 0 [Note] InnoDB: Using Linux native AIO
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681304Z 0 [Note] InnoDB: Number of pools: 1
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.681369Z 0 [Note] InnoDB: Using CPU crc32 instructions
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.682440Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.687878Z 0 [Note] InnoDB: Completed initialization of buffer pool
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.689386Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.721122Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.755720Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.756235Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.830478Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.840143Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.840161Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.840606Z 0 [Note] InnoDB: Waiting for purge to start
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.891432Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 2535558
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.891977Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.892056Z 0 [Note] Plugin 'FEDERATED' is disabled.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.931384Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170629 14:49:23
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.934426Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.936509Z 0 [Warning] CA certificate ca.pem is self signed.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.952553Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.952645Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.952829Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.953123Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:23.976984Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:24.115430Z 0 [Note] Event Scheduler: Loaded 0 events
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:24.115572Z 0 [Note] mysqld: ready for connections.
lampstack_db.1.wgofhqdl1v33@moby    | Version: '5.7.18'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL)
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:24.115578Z 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.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:24.115580Z 0 [Note] Beginning of list of non-natively partitioned tables
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:24.235357Z 0 [Note] End of list of non-natively partitioned tables
lampstack_db.1.wgofhqdl1v33@moby    | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
lampstack_db.1.wgofhqdl1v33@moby    | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
lampstack_db.1.wgofhqdl1v33@moby    | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.307433Z 5 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.307454Z 5 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.307466Z 5 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.307476Z 5 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.307498Z 5 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    |
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.308688Z 0 [Note] Giving 0 client threads a chance to die gracefully
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.308701Z 0 [Note] Shutting down slave threads
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.308704Z 0 [Note] Forcefully disconnecting 0 remaining clients
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.308706Z 0 [Note] Event Scheduler: Purging the queue. 0 events
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.308730Z 0 [Note] Binlog end
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317357Z 0 [Note] Shutting down plugin 'ngram'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317377Z 0 [Note] Shutting down plugin 'BLACKHOLE'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317381Z 0 [Note] Shutting down plugin 'partition'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317383Z 0 [Note] Shutting down plugin 'ARCHIVE'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317385Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317387Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317388Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317389Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317391Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317392Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317393Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317394Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317395Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317397Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317398Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317399Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317400Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317401Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317403Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317404Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317405Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317406Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317408Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317409Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317410Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317411Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317412Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317414Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317415Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317417Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317419Z 0 [Note] Shutting down plugin 'INNODB_CMP'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317421Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317423Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317425Z 0 [Note] Shutting down plugin 'INNODB_TRX'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317427Z 0 [Note] Shutting down plugin 'InnoDB'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317486Z 0 [Note] InnoDB: FTS optimize thread exiting.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.317588Z 0 [Note] InnoDB: Starting shutdown...
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.418806Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:26.428161Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170629 14:49:26
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.856347Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12139694
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859197Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859225Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859229Z 0 [Note] Shutting down plugin 'MyISAM'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859239Z 0 [Note] Shutting down plugin 'CSV'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859280Z 0 [Note] Shutting down plugin 'MEMORY'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859282Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859306Z 0 [Note] Shutting down plugin 'sha256_password'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859312Z 0 [Note] Shutting down plugin 'mysql_native_password'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.859446Z 0 [Note] Shutting down plugin 'binlog'
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:27.860931Z 0 [Note] mysqld: Shutdown complete
lampstack_db.1.wgofhqdl1v33@moby    |
lampstack_db.1.wgofhqdl1v33@moby    |
lampstack_db.1.wgofhqdl1v33@moby    | MySQL init process done. Ready for start up.
lampstack_db.1.wgofhqdl1v33@moby    |
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.121719Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.126586Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 1 ...
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134269Z 0 [Note] InnoDB: PUNCH HOLE support available
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134297Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134301Z 0 [Note] InnoDB: Uses event mutexes
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134303Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134305Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134306Z 0 [Note] InnoDB: Using Linux native AIO
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134586Z 0 [Note] InnoDB: Number of pools: 1
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.134962Z 0 [Note] InnoDB: Using CPU crc32 instructions
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.136240Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.142101Z 0 [Note] InnoDB: Completed initialization of buffer pool
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.143292Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.183384Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.242543Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.242892Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.310986Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.317119Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.317140Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.317361Z 0 [Note] InnoDB: Waiting for purge to start
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.367892Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 12139694
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.368297Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.368339Z 0 [Note] Plugin 'FEDERATED' is disabled.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.396380Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.406576Z 0 [Warning] CA certificate ca.pem is self signed.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.408554Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.408580Z 0 [Note] IPv6 is available.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.408586Z 0 [Note]   - '::' resolves to '::';
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.408598Z 0 [Note] Server socket created on IP: '::'.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.409911Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170629 14:49:28
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.423707Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.423739Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.423871Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.424004Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.442753Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.524101Z 0 [Note] Event Scheduler: Loaded 0 events
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.524336Z 0 [Note] mysqld: ready for connections.
lampstack_db.1.wgofhqdl1v33@moby    | Version: '5.7.18'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.524369Z 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.
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.524372Z 0 [Note] Beginning of list of non-natively partitioned tables
lampstack_db.1.wgofhqdl1v33@moby    | 2017-06-29T14:49:28.641848Z 0 [Note] End of list of non-natively partitioned tables

1 个答案:

答案 0 :(得分:1)

创建秘密内联时,我在Windows机器上运行linux容器时遇到相同的问题。

  

echo mypassword |码头工人秘密创建mysql_db_root-

将保存实际密码,并在末尾添加空格,回车符和换行符。如果查看文件中的字节,可以看到这一点。在正在运行的mysql容器中,您可以使用od命令,如以下示例所示,以查看字节。或在容器外部,您可以将/ run / secrets / mysql_db_root内容转储到文件中,并在Windows上使用您喜欢的十六进制编辑器进行查看,以查看添加的字节。

  

od -xa / run / secrets / mysql_db_root

要解决此问题,请通过将密码放入文件中,然后使用该文件生成Docker密码来创建密码。有关更多详细信息,请参见mysql github issue

  

docker secret创建mysql_db_root mypasswordfile.txt