我想用openresty构建alticelabs/nginx-log-zmq。
我的命令看起来像the instructions:
./configure --add-module=../nginx-log-zmq-master
make
make install
但是,当使用任何log_zmq_server
之类的zmq指令运行nginx时,nginx会在启动时中止:
$ /usr/local/openresty/bin/openresty
> 2018/11/03 21:06:06 [emerg] 1#0: unknown directive "log_zmq_server" in /usr/local/openresty/nginx/conf/nginx.conf:13
我确信编译本身可以工作,因为日志显示它已正确编译,并且由于缺少依赖项(libzmq3-dev),它还报告了一个错误:
adding module in /openresty-1.13.6.1/../nginx-log-zmq-master
checking for ZeroMQ library ... found
+ ngx_http_log_zmq_module was configured
[...]
完整的日志输出位于https://paste.ee/p/BCdf6。
我的dockerfile:
FROM ubuntu:xenial
RUN apt-get -y update \
&& apt-get -y upgrade \
&& apt-get install -y \
libpcre3 \
libpcre3-dev \
libssl-dev \
libperl4-corelibs-perl \
libzmq3-dev \
g++ \
cmake \
unzip \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/openresty/openresty/releases/download/v1.13.6.1/openresty-1.13.6.1.tar.gz \
&& wget https://github.com/alticelabs/nginx-log-zmq/archive/master.zip \
&& unzip master.zip \
&& rm master.zip \
&& tar -xvf openresty-1.13.6.1.tar.gz \
&& rm openresty-1.13.6.1.tar.gz \
&& cd openresty-1.13.6.1/ \
&& ./configure --add-module=../nginx-log-zmq-master -j2 \
&& make -j2 \
&& make install \
&& cd .. \
&& rm -r openresty-1.13.6.1 \
&& rm -r nginx-log-zmq-master
# connect stdout & stderr
RUN ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log
COPY cmd.sh /usr/bin/cmd.sh
RUN chmod +x /usr/bin/cmd.sh
# copy configs
COPY *.conf /usr/local/openresty/nginx/conf/
COPY *.lua /usr/local/openresty/nginx/lua/
CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]