From a8c1212fe2c3f613f40c3060b8b04dbbb848a702 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <1paneldev@sina.com> Date: Wed, 7 May 2025 14:08:34 +0800 Subject: [PATCH] feat: update openresty dockerfile --- openresty/1.27.1.2-0-1-focal/build/Dockerfile | 8 ++++++-- .../1.27.1.2-0-1-focal/build/tmp/default.sh | 17 +---------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/openresty/1.27.1.2-0-1-focal/build/Dockerfile b/openresty/1.27.1.2-0-1-focal/build/Dockerfile index bd358c2e0..4bee36138 100644 --- a/openresty/1.27.1.2-0-1-focal/build/Dockerfile +++ b/openresty/1.27.1.2-0-1-focal/build/Dockerfile @@ -4,6 +4,7 @@ ARG RESTY_IMAGE_BASE="ubuntu" ARG RESTY_IMAGE_TAG="focal" +ARG CONTAINER_PACKAGE_URL ARG PANEL_OPENRESTY_VERSION FROM 1panel/openresty:${PANEL_OPENRESTY_VERSION} as panel-openresty @@ -114,8 +115,8 @@ LABEL resty_luajit_options="${RESTY_LUAJIT_OPTIONS}" LABEL resty_pcre_options="${RESTY_PCRE_OPTIONS}" COPY tmp /tmp -#RUN sed -i "s|http://archive.ubuntu.com/ubuntu/|${CONTAINER_PACKAGE_URL}|g" /etc/apt/sources.list \ -# && sed -i "s|http://security.ubuntu.com/ubuntu/|${CONTAINER_PACKAGE_URL}|g" /etc/apt/sources.list +RUN sed -i "s|http://archive.ubuntu.com/ubuntu/|${CONTAINER_PACKAGE_URL}|g" /etc/apt/sources.list \ + && sed -i "s|http://security.ubuntu.com/ubuntu/|${CONTAINER_PACKAGE_URL}|g" /etc/apt/sources.list RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ @@ -134,9 +135,11 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ unzip \ wget \ zlib1g-dev \ + git \ ${RESTY_ADD_PACKAGE_BUILDDEPS} \ ${RESTY_ADD_PACKAGE_RUNDEPS} \ && cd /tmp \ + && bash /tmp/pre.sh \ && if [ -n "${RESTY_EVAL_PRE_CONFIGURE}" ]; then eval $(echo ${RESTY_EVAL_PRE_CONFIGURE}); fi \ # && curl -fSL "${RESTY_OPENSSL_URL_BASE}/openssl-${RESTY_OPENSSL_VERSION}.tar.gz" -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ && tar xzf openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ @@ -209,6 +212,7 @@ COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf RUN bash /tmp/default.sh + COPY --from=panel-openresty /usr/local/openresty/1pwaf /usr/local/openresty/1pwaf COPY --from=panel-openresty /usr/local/openresty/1pwaf/libraries/libmaxminddb.so /usr/local/openresty/1pwaf/libraries/libmaxminddb.so COPY --from=panel-openresty /usr/local/openresty/1pwaf/libraries/libinjection.so /usr/local/openresty/1pwaf/libraries/libinjection.so diff --git a/openresty/1.27.1.2-0-1-focal/build/tmp/default.sh b/openresty/1.27.1.2-0-1-focal/build/tmp/default.sh index a58202d25..6c16d6796 100644 --- a/openresty/1.27.1.2-0-1-focal/build/tmp/default.sh +++ b/openresty/1.27.1.2-0-1-focal/build/tmp/default.sh @@ -2,19 +2,4 @@ apt-get install -y --no-install-recommends libsqlite3-dev git python3 automake a && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && luarocks install luafilesystem \ - && mkdir -p /usr/local/openresty/1pwaf/libraries -# && unzip /tmp/libmaxminddb.zip -d /tmp \ -# && cd /tmp/libmaxminddb \ -# && ./configure \ -# && make \ -# && make install \ -# && unzip /tmp/libinjection-main.zip -d /tmp \ -# && cd /tmp/libinjection-main \ -# && make all \ -# && unzip /tmp/lsqlite3.zip -d /tmp \ -# && cd /tmp/lsqlite3 \ -# && make all \ -# && mkdir -p /usr/local/openresty/1pwaf/libraries/ \ -# && cp /usr/local/lib/libmaxminddb.so.0.0.7 /usr/local/openresty/1pwaf/libraries/libmaxminddb.so \ -# && cp /tmp/libinjection-main/src/.libs/libinjection.so.1.2.9 /usr/local/openresty/1pwaf/libraries/libinjection.so \ -# && cp /tmp/lsqlite3/lsqlite3.so /usr/local/openresty/luajit/lib/lua/5.1/lsqlite3.so + && mkdir -p /usr/local/openresty/1pwaf/libraries