
我正在尝试在 Dockerfile 中为 mysql 数据库设置 root 密码,如下所示:
(short version)
ENV DEBIAN_FRONTEND noninteractive
RUN echo mysql-community-server mysql-community-server/root-pass password 'mypassword' | debconf-set-selections && \
echo mysql-community-server mysql-community-server/re-root-pass password 'mypassword' | debconf-set-selections
RUN apt-get install mysql-server...
当我尝试在 KVM 中执行此操作时,它工作得很好,但不知何故,我的 root 密码在 docker conainer 中不被接受 - 在我看到的日志文件中,已设置了一个空的 root 密码。我也尝试过不使用ENV DEBIAN_FRONTEND noninteractive
.有人有想法吗?