From 4939fa6df7ffdde0cf224a562f9878c50bf493f0 Mon Sep 17 00:00:00 2001 From: "Ivan Kuchin (ikuchin)" Date: Wed, 16 Aug 2023 16:44:01 -0400 Subject: [PATCH] Revert "Infrastructure: upgrade base-container to ubuntu:jammy" This reverts commit 0849ff6c98bdce046344e9488ef1cc7b8e6ace4b. --- supplemental/docker/prod/Dockerfile | 99 +++++++++++++++-------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/supplemental/docker/prod/Dockerfile b/supplemental/docker/prod/Dockerfile index d2ed427..0a2d9ba 100644 --- a/supplemental/docker/prod/Dockerfile +++ b/supplemental/docker/prod/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:jammy as base +FROM ubuntu:xenial as base ARG BUILD_REPO ARG MAIN_SUBDOMAIN=www @@ -19,19 +19,6 @@ LABEL org.opencontainers.image.source="https://github.com/IvanKuchin/${BUILD_REP RUN [ -z "$BUILD_REPO" ] && echo "BUILD_REPO is required" && exit 1 || true RUN echo repository is $BUILD_REPO -############################ -# make apt non-interactive # -############################ -ENV DEBIAN_FRONTEND noninteractive -ENV DEBCONF_NONINTERACTIVE_SEEN true - -#################### -# preseed timezone # -#################### -RUN echo tzdata tzdata/Areas select Europe > /tmp/preseed.txt \ - && echo tzdata tzdata/Zones/Europe select Moscow >> /tmp/preseed.txt \ - && debconf-set-selections /tmp/preseed.txt - ########################### # install basic utilities # ########################### @@ -43,6 +30,15 @@ RUN apt update \ gettext \ && rm -rf /var/lib/apt/lists/* +#################### +# install timezone # +#################### +#RUN apt-get install --no-install-recommends --no-install-suggests -y tzdata \ +# && rm -rf /var/lib/apt/lists/* +RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime +RUN echo "Europe/Moscow" > /etc/timezone +RUN date + ############################## # install additional locales # ############################## @@ -70,6 +66,9 @@ ARG BUILD_RELEASE_NUMBER # install dependencies # ######################## RUN apt update \ + && apt-get install --no-install-recommends --no-install-suggests -y software-properties-common \ + && add-apt-repository -y ppa:jonathonf/ffmpeg-4 \ + && apt update \ && apt-get install --no-install-recommends --no-install-suggests -y \ build-essential \ file \ @@ -111,22 +110,22 @@ COPY . ${GIT_FOLDER} WORKDIR ${GIT_FOLDER} RUN git clone --depth 1 https://github.com/IvanKuchin/backend_pi.git ./src/pi -###################### -# libxl installation # -###################### -RUN if test -f "./libxl-3.8.4.0/lib64/libxl.so"; then \ - cp ./libxl-3.8.4.0/lib64/libxl.so /usr/local/lib/ \ - && ldconfig; \ - fi - -############################# -# libwkhtmltox installation # -############################# -RUN if test -d "./wkhtmltox"; then \ - wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb \ - && apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox*.deb; \ - fi - +###################### +# libxl installation # +###################### +RUN if test -f "./libxl-3.8.4.0/lib64/libxl.so"; then \ + cp ./libxl-3.8.4.0/lib64/libxl.so /usr/local/lib/ \ + && ldconfig; \ + fi + +############################# +# libwkhtmltox installation # +############################# +RUN if test -d "./wkhtmltox"; then \ + wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb \ + && apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox*.deb; \ + fi + ################## # save commit id # ################## @@ -191,7 +190,7 @@ RUN cd build \ # STOPSIGNAL SIGTERM -# CMD ["apachectl", "-D", "FOREGROUND"] +# CMD ["apachectl", "-D", "FOREGROUND", ""] ############################################################################################ @@ -213,17 +212,17 @@ COPY --from=build ${GIT_FOLDER}/build/${BUILD_REPO}-infra.deb ./ COPY --from=build ${GIT_FOLDER}/build/${BUILD_REPO}-app.deb ./ COPY --from=build ${GIT_FOLDER}/supplemental/apache2/ /etc/apache2/ -############### -# copy libxl # -############### -COPY --from=build /usr/local/lib/libxl* /usr/local/lib/ -RUN ldconfig - -################### -# copy wkhtmltox # -################### -COPY --from=build ${GIT_FOLDER}/wkhtmltox*.deb ./ - +############### +# copy libxl # +############### +COPY --from=build /usr/local/lib/libxl* /usr/local/lib/ +RUN ldconfig + +################### +# copy wkhtmltox # +################### +COPY --from=build ${GIT_FOLDER}/wkhtmltox*.deb ./ + #################### # install binaries # #################### @@ -232,10 +231,10 @@ RUN apt update \ #software-properties-common \ ssmtp \ apache2 \ - gsfonts \ - wget \ + gsfonts \ + wget \ && apt install --no-install-recommends --no-install-suggests -y ./*.deb \ - && apt remove -y wget \ + && apt remove -y wget \ && rm -rf /var/lib/apt/lists/* ######################### @@ -271,7 +270,7 @@ RUN chown -R www-data:www-data ${ROOTDIR} \ EXPOSE 80 -CMD ["apachectl", "-D", "FOREGROUND"] +CMD ["apachectl", "-D", "FOREGROUND", ""] ############################################################################################ @@ -298,8 +297,12 @@ COPY --from=build ${GIT_FOLDER}/supplemental/apache2/ /etc/apache2/ #################### RUN apt update \ && apt-get install --no-install-recommends --no-install-suggests -y \ + software-properties-common \ + # ssmtp \ apache2 \ - && apt install --no-install-recommends --no-install-suggests -y ffmpeg \ + && add-apt-repository -y ppa:jonathonf/ffmpeg-4 \ + && apt update \ + && apt install --no-install-recommends --no-install-suggests -y ffmpeg \ && apt install --no-install-recommends --no-install-suggests -y ./*.deb \ && apt autoremove -y software-properties-common \ && rm -rf /var/lib/apt/lists/* @@ -337,7 +340,7 @@ RUN chown -R www-data:www-data ${ROOTDIR} \ EXPOSE 80 -CMD ["apachectl", "-D", "FOREGROUND"] +CMD ["apachectl", "-D", "FOREGROUND", ""] ############################################################################################