如何在安装库时跳过输入密码

如何在安装库时跳过输入密码

我安装了该库。

$sudo apt-get install slapd ldap-utils

安装时它会停下来并询问,

please enter the password for the admin entry in your ldap directory.

我正在使用 Dockerfile,所以我想跳过这个过程。

是否可以?

答案1

我确实喜欢这个dockerfile

RUN echo 'slapd/root_password password password' | debconf-set-selections &&\
    echo 'slapd/root_password_again password password' | debconf-set-selections && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y slapd ldap-utils

#RUN apt-get install -y python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev
RUN apt-get install -y build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev 

RUN echo "slapd slapd/no_configuration boolean false" | debconf-set-selections
RUN echo "slapd slapd/domain string ldaptest.local" | debconf-set-selections
RUN echo "slapd shared/organization string 'LDAP Test'" | debconf-set-selections
RUN echo "slapd slapd/password1 password root_password" | debconf-set-selections
RUN echo "slapd slapd/password2 password root_password" | debconf-set-selections
RUN echo "jslapd slapd/backend select HDB" | debconf-set-selections
RUN echo "slapd slapd/purge_database boolean true" | debconf-set-selections
RUN echo "slapd slapd/allow_ldap_v2 boolean false" | debconf-set-selections
RUN echo "slapd slapd/move_old_database boolean true" | debconf-set-selections

RUN dpkg-reconfigure -f noninteractive slapd

RUN apt-get install ldap-utils slapd -y

#RUN apt-get install slapd -qq

RUN apt-get install ldap-utils tox lcov valgrind -y

相关内容