我已经设置了 ENV 变量,但容器仍然抛出错误,提示我应该设置它们。
这是我想要使用的图像:mysql-56-centos7。
关于如何修复此问题有什么建议吗?
Dockerfile:
FROM centos/mysql-56-centos7
ENV MYSQL_USER=root \
MYSQL_PASSWORD=test \
MYSQL_DATABASE=test \
MYSQL_DATA_DIR=/var/lib/mysql \
MYSQL_RUN_DIR=/run/mysqld \
MYSQL_LOG_DIR=/var/log/mysql
EXPOSE 3306/tcp
CMD ["run-mysqld"]
以下是错误:
[root@centos1 test01]# docker container logs cf0245546d47
=> sourcing 20-validate-variables.sh ...
You must either specify the following environment variables:
MYSQL_USER (regex: '^[a-zA-Z0-9_]+$')
MYSQL_PASSWORD (regex: '^[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]+$')
MYSQL_DATABASE (regex: '^[a-zA-Z0-9_]+$')
Or the following environment variable:
MYSQL_ROOT_PASSWORD (regex: '^[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]+$')
Or both.
Optional Settings:
MYSQL_LOWER_CASE_TABLE_NAMES (default: 0)
MYSQL_LOG_QUERIES_ENABLED (default: 0)
MYSQL_MAX_CONNECTIONS (default: 151)
MYSQL_FT_MIN_WORD_LEN (default: 4)
MYSQL_FT_MAX_WORD_LEN (default: 20)
MYSQL_AIO (default: 1)
MYSQL_KEY_BUFFER_SIZE (default: 32M or 10% of available memory)
MYSQL_MAX_ALLOWED_PACKET (default: 200M)
MYSQL_TABLE_OPEN_CACHE (default: 400)
MYSQL_SORT_BUFFER_SIZE (default: 256K)
MYSQL_READ_BUFFER_SIZE (default: 8M or 5% of available memory)
MYSQL_INNODB_BUFFER_POOL_SIZE (default: 32M or 50% of available memory)
MYSQL_INNODB_LOG_FILE_SIZE (default: 8M or 15% of available memory)
MYSQL_INNODB_LOG_BUFFER_SIZE (default: 8M or 15% of available memory)