Make sure DEBIAN_FRONTEND is set for all apt-get commands

Do that by parameterising the apt-get
This commit is contained in:
sbts 2017-07-09 16:43:53 +08:00
parent b8694aa449
commit fafaea715e

View File

@ -1,9 +1,12 @@
FROM debian:jessie FROM debian:jessie
MAINTAINER Freelock john@freelock.com MAINTAINER Freelock john@freelock.com
ENV APT_cmd DEBIAN_FRONTEND="noninteractive" apt-get -y
# Install Perl, Tex, Starman, psql client, and all dependencies # Install Perl, Tex, Starman, psql client, and all dependencies
RUN echo -e "APT::Install-Recommends \"false\";\nAPT::Install-Suggests \"false\";\n" > /etc/apt/apt.conf.d/00recommends && \ RUN echo -e "APT::Install-Recommends \"false\";\nAPT::Install-Suggests \"false\";\n" > /etc/apt/apt.conf.d/00recommends && \
apt-get update DEBIAN_FRONTEND="noninteractive" apt-get -y install && \ ${APT_cmd} update && \
${APT_cmd} install && \
libcgi-emulate-psgi-perl libcgi-simple-perl libconfig-inifiles-perl \ libcgi-emulate-psgi-perl libcgi-simple-perl libconfig-inifiles-perl \
libdbd-pg-perl libdbi-perl libdatetime-perl \ libdbd-pg-perl libdbi-perl libdatetime-perl \
libdatetime-format-strptime-perl libdigest-md5-perl \ libdatetime-format-strptime-perl libdigest-md5-perl \
@ -23,8 +26,8 @@ RUN echo -e "APT::Install-Recommends \"false\";\nAPT::Install-Suggests \"false\"
postgresql-client \ postgresql-client \
ssmtp \ ssmtp \
lsb-release \ lsb-release \
&& apt-get autoremove -y \ && ${APT_cmd} autoremove \
&& apt-get autoclean \ && ${APT_cmd} autoclean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -44,8 +47,8 @@ ENV DOJO_Build_Deps git make gcc libperl-dev npm curl
# These packages can be removed after the dojo build # These packages can be removed after the dojo build
ENV DOJO_Build_Deps_removal ${DOJO_Build_Deps} nodejs ENV DOJO_Build_Deps_removal ${DOJO_Build_Deps} nodejs
RUN apt-get update && \ RUN ${APT_cmd} update && \
DEBIAN_FRONTEND="noninteractive" apt-get -y install ${DOJO_Build_Deps} && \ ${APT_cmd} install ${DOJO_Build_Deps} && \
update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100 && \ update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100 && \
cd /srv && \ cd /srv && \
git clone --recursive -b $LSMB_VERSION https://github.com/ledgersmb/LedgerSMB.git ledgersmb && \ git clone --recursive -b $LSMB_VERSION https://github.com/ledgersmb/LedgerSMB.git ledgersmb && \
@ -58,10 +61,10 @@ RUN apt-get update && \
--installdeps . && \ --installdeps . && \
npm install -g uglify-js@">=2.0 <3.0" && \ npm install -g uglify-js@">=2.0 <3.0" && \
make dojo && \ make dojo && \
apt-get purge -y ${DOJO_Build_Deps_removal} && \ ${APT_cmd} purge ${DOJO_Build_Deps_removal} && \
rm -rf /usr/local/lib/node_modules && \ rm -rf /usr/local/lib/node_modules && \
apt-get autoremove -y && \ ${APT_cmd} autoremove && \
apt-get autoclean && \ ${APT_cmd} autoclean && \
rm -rf ~/.cpanm && \ rm -rf ~/.cpanm && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
@ -96,4 +99,5 @@ RUN mkdir -p /tmp && \
# Internal Port Expose # Internal Port Expose
EXPOSE 5762 EXPOSE 5762
USER www-data
CMD ["start.sh"] CMD ["start.sh"]