From 9cc1a020f3eb25e5d2bb8d122c2345c77cb55040 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 17 Apr 2022 21:59:02 +0400 Subject: [PATCH] Have a variable to control debug info in docker image --- .github/workflows/docker.yml | 2 +- Telegram/build/docker/centos_env/Dockerfile | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dc456da5c..5657e07c6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -22,4 +22,4 @@ jobs: submodules: recursive - name: Docker image build. - run: docker build -t telegram_desktop Telegram/build/docker/centos_env + run: docker build -t telegram_desktop --build-arg DEBUG= Telegram/build/docker/centos_env diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index b5db0f2f9..4e93b4ccc 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -1,5 +1,6 @@ -FROM centos:7 AS builder +ARG DEBUG 1 +FROM centos:7 AS builder ENV GIT https://github.com ENV GIT_FREEDESKTOP ${GIT}/gitlab-freedesktop-mirrors ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig @@ -527,6 +528,7 @@ COPY --from=wayland ${LibrariesPath}/wayland-cache / COPY --from=openssl ${LibrariesPath}/openssl-cache / COPY --from=xkbcommon ${LibrariesPath}/xkbcommon-cache / +ARG DEBUG RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} \ && cd qt_${QT} \ && perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat \ @@ -535,7 +537,7 @@ RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} \ && cd .. \ && ./configure -prefix "$QT_PREFIX" \ -release \ - -force-debug-info \ + ${DEBUG:+-force-debug-info} \ -opensource \ -confirm-license \ -libproxy \ @@ -609,8 +611,10 @@ RUN cmake --build out --config Release --parallel \ && find out -mindepth 1 -maxdepth 1 ! -name Release -exec rm -rf {} \; FROM webrtc AS webrtc_debug -RUN cmake --build out --config Debug --parallel \ - && find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \; +ARG DEBUG +RUN [ -z "$DEBUG" ] || (cmake --build out --config Debug --parallel \ + && find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \;) +RUN [ -n "$DEBUG" ] || mkdir -p out/Debug FROM builder COPY --from=libffi ${LibrariesPath}/libffi-cache /