dockerfile 中静默安装mysql

RUN apt-get update \
    && apt-get install -y debconf-utils \
    && echo mysql-server-5.5 mysql-server/root_password password xyzzy | debconf-set-selections \
    && echo mysql-server-5.5 mysql-server/root_password_again password xyzzy | debconf-set-selections \
    && apt-get install -y mysql-server-5.5 -o pkg::Options::="--force-confdef" -o pkg::Options::="--force-confold" --fix-missing \
    && apt-get install -y net-tools --fix-missing \

    && rm -rf /var/lib/apt/lists/*\


RUN apt-get update
RUN echo "mysql-server mysql-server/root_password password root" | debconf-set-selections
RUN echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections
RUN apt-get install -y mysql-server

你可能感兴趣的:(dockerfile 中静默安装mysql)