docker-images - Dockerfile build install mysql的时候,弹出输入root密码之后,没反应?
仅有的幸福
仅有的幸福 2017-04-26 09:03:32
0
2
929

Dockerfile build 执行命令apt-get install mysql-server的时候,弹出输入root密码之后,输入秘密,回车,没反应啊!这怎么回事?

Dockfile:

FROM ubuntu:latest RUN apt-get -qq update RUN apt-get install -qqy nginx mysql-server php-mcrypt
仅有的幸福
仅有的幸福

reply all (2)
習慣沉默

mysql cannot be installed directly like this.

You should refer to the following mysql official image:

ENV MYSQL_VERSION 8.0.0-dmr-1debian8 RUN echo "deb http://repo.mysql.com/apt/debian/ jessie mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter RUN { \ echo mysql-community-server mysql-community-server/data-dir select ''; \ echo mysql-community-server mysql-community-server/root-pass password ''; \ echo mysql-community-server mysql-community-server/re-root-pass password ''; \ echo mysql-community-server mysql-community-server/remove-test-db select false; \ } | debconf-set-selections \ && apt-get update && apt-get install -y mysql-server="${MYSQL_VERSION}"
    漂亮男人

    Does anyone know? Have you ever encountered it?

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!