FROM mysql:5.7 # FROM mysql:8 ENV MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql-root-pass \ MYSQL_USER=demo \ MYSQL_DATABASE=demo \ MYSQL_PASSWORD_FILE=/run/secrets/mysql-demo-pass COPY ./sql/* /docker-entrypoint-initdb.d/ # 更改配置文件 #COPY ./my.cnf /etc/my.cnf CMD ["mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"]