1- FROM debian:12.9 as libjwt-builder
1+ FROM debian:12.9
22
33WORKDIR /home/app
44RUN apt update
@@ -13,17 +13,48 @@ RUN git clone --depth 1 --branch v3.2.0 https://github.com/benmcollins/libjwt.gi
1313 mkdir libjwt/build && \
1414 cd libjwt/build && cmake .. && make && make install
1515
16- FROM openresty/openresty:1.25.3.2-3-bullseye-valgrind
1716
18- RUN apt update
19- RUN apt install -y cpanminus valgrind libjansson-dev
17+ # # install openresty-valgrind
18+
19+ RUN DEBIAN_FRONTEND=noninteractive apt update \
20+ && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
21+ ca-certificates \
22+ gettext-base \
23+ gnupg2 \
24+ lsb-base \
25+ lsb-release \
26+ software-properties-common \
27+ wget gnupg ca-certificates
28+ RUN wget -qO - "https://openresty.org/package/pubkey.gpg" | gpg --dearmor > /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
29+ && chown root:root /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
30+ && chmod ugo+r /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
31+ && chmod go-w /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
32+ && echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/openresty-keyring.gpg] https://openresty.org/package/debian $(grep -Po 'VERSION=" [0-9]+ \(\K [^)]+' /etc/os-release) openresty" | tee /etc/apt/sources.list.d/openresty.list
33+
34+ ENV PATH="$PATH:/usr/local/openresty-valgrind/luajit/bin:/usr/local/openresty-valgrind/nginx/sbin:/usr/local/openresty-valgrind/bin"
35+
36+
37+ # Use SIGQUIT instead of default SIGTERM to cleanly drain requests
38+ # See https://github.com/openresty/docker-openresty/blob/master/README.md#tips--pitfalls
39+ STOPSIGNAL SIGQUIT
40+
41+ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
42+ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
43+ openresty-valgrind valgrind
44+
45+ RUN mkdir -p /var/run/openresty \
46+ && ln -sf /dev/stdout /usr/local/openresty-valgrind/nginx/logs/access.log \
47+ && ln -sf /dev/stderr /usr/local/openresty-valgrind/nginx/logs/error.log
48+
49+ RUN DEBIAN_FRONTEND=noninteractive apt update \
50+ && DEBIAN_FRONTEND=noninteractive apt install -y cpanminus valgrind libjansson-dev
51+
2052RUN cpanm -v --notest Test::Nginx
2153
2254COPY ./lib/resty/libjwt /usr/local/openresty/lualib/resty/libjwt
2355COPY ./lib/resty/libjwt /usr/local/openresty-valgrind/lualib/resty/libjwt
24- COPY --from=libjwt-builder /usr/local/lib/libjwt.so /usr/local/lib/libjwt.so
25- RUN ldconfig
2656
57+ WORKDIR /
2758COPY ./.memory_leak/test /t
2859COPY ./.memory_leak/valgrind.suppress /valgrind.suppress
2960COPY ./.memory_leak/valgrind.awk /valgrind.awk
0 commit comments