From 5450fb60981c62f626bd2dda20e2a69a89ed0a04 Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Thu, 22 Jun 2023 20:22:28 +0300 Subject: [PATCH] Add ccache to PATH and use it for compiling nginx with Makefile in build_nginx.sh script --- docker/build_nginx.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/build_nginx.sh b/docker/build_nginx.sh index ce50fa37a..1e7bfad21 100755 --- a/docker/build_nginx.sh +++ b/docker/build_nginx.sh @@ -16,7 +16,9 @@ apt-get -yqq build-dep nginx apt-get -yqq install --no-install-recommends ca-certificates wget update-ca-certificates -f apt install -y ccache -CC="ccache gcc" + +export PATH="/usr/lib/ccache:$PATH" + mkdir /tmp/nginx wget -nv https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz tar -zxf nginx-${NGINX_VERSION}.tar.gz -C /tmp/nginx --strip-components=1 @@ -64,5 +66,5 @@ cd /tmp/nginx --add-module=../nginx-rtmp-module \ --with-cc-opt="-O3 -Wno-error=implicit-fallthrough" -make -j$(nproc) && make install +make CC="ccache gcc" -j$(nproc) && make install rm -rf /usr/local/nginx/html /usr/local/nginx/conf/*.default