要約は、次の2つのブログと彼ら自身の実践に基づいています。
https://askubuntu.com/questions/762339/mysql-server-installation-stuck-on-root-password
https://blog.csdn.net/y353027520dx/article/details/77621468
1.環境
ubuntu16.04
python3.6
2.インストール手順の記録
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
LABEL maintainer myname
....
ENV MYSQL_PWD your_passwd
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 update && \
apt-get -y install MySQL-server-core-5.7 mysql-client-5.7 mysql-server-5.7 --no-install-recommends && \
pip --default-time=500 install -i https://pypi.tuna.tsinghua.edu.cn/simple pymysql &&\
rm -rf /var/lib/apt/lists/*
3.まとめ
私にとってより難しい問題は、aptを介してmysql-serverを直接インストールすると、パスワードを入力した後、応答がなく、実行が継続されなくなることです。多くのメソッドを検索し、状況を解決できませんでした。
1)mysql dockerに関連するものを見ましたが、解決されていません。
2)aptを使用してMySQL-server-core-5.7 mysql-client-5.7mysql-server-5.7を直接インストールします。
3)aptの後に-パラメータを変更します。
4)echoを実行するときは、「root」パスワードを入力します。
5)「root」パスワードを手動で入力します。
待ってください、私はそれを解決していません、そしてそれから私は2でインストールする前にパスワード操作を入力する必要があります。