我尝试安装mysql-server
到一个Docker
容器中,因此在我的 Dockerfile 中我添加了apt-get install mysql-server
安装,安装一直运行直到它要求提供 root 用户的密码,然后就卡在那里,即使我提供一个空白密码也没有任何事情发生。
Configuring mysql-server-5.5
While not mandatory, it is highly recommended that you set a password for the
MySQL administrative "root" user.
If this field is left blank, the password will not be changed.
New password for the MySQL "root" user:
我不知道这是否是一个错误或者是否与 docker 有关。有人遇到过这种情况吗?
答案1
您必须设置密码前安装 MySQL:
# MySQL
ENV MYSQL_PWD Pwd123
RUN echo "mysql-server mysql-server/root_password password $MYSQL_PWD" | debconf-set-selections
RUN echo "mysql-server mysql-server/root_password_again password $MYSQL_PWD" | debconf-set-selections
RUN apt-get -y install mysql-server