首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用docker安装后,Nginx目录/etc/nginx为空

使用docker安装后,Nginx目录/etc/nginx为空
EN

Stack Overflow用户
提问于 2020-05-19 23:07:52
回答 1查看 123关注 0票数 0

我尝试使用rtmp模块和我自己的补丁来安装nginx,但是安装之后/erc/nginx文件夹是空的。

我的Dockerfile

代码语言:javascript
复制
FROM debian:10

ARG ROOT=/tmp/build
ARG NGINXV=1.18.0
ARG FILE_PATH=/tmp/patch
ARG INSTANCE=nginx

RUN mkdir -p $FILE_PATH
COPY patch/nginx-rtmp-module-sl1.patch $FILE_PATH

RUN apt-get update && apt-get install -y \
        git \
        libpcre3 \
        libpcre3-dev \
        openssl \
        libssl-dev \
        zlib1g \
        zlib1g-dev \
        libzmq3-dev \
        wget \
        patch \
        gcc \
        make

RUN   mkdir -p $ROOT \
      && cd $ROOT \
      && rm -rf nginx-$NGINXV nginx-rtmp-module nginx-push-stream-module \
      && [ -f nginx-$NGINXV.tar.gz ] || wget https://nginx.org/download/nginx-$NGINXV.tar.gz \
      && tar xvzf nginx-$NGINXV.tar.gz \
      && git clone https://github.com/wandenberg/nginx-push-stream-module \
      && git clone https://github.com/arut/nginx-rtmp-module \
      && cd nginx-rtmp-module \
      && patch -p1 < /$FILE_PATH/nginx-rtmp-module-sl1.patch \
      && cd .. \
      && cd nginx-$NGINXV \
      && ./configure \
            --prefix=/etc/$INSTANCE \
            --sbin-path=/usr/sbin/$INSTANCE \
            --conf-path=/etc/$INSTANCE/$INSTANCE.conf \
            --error-log-path=/var/log/$INSTANCE/error.log \
            --http-log-path=/var/log/$INSTANCE/access.log \
            --pid-path=/var/run/$INSTANCE.pid \
            --lock-path=/var/run/$INSTANCE.lock \
            --http-client-body-temp-path=/var/cache/$INSTANCE/client_temp \
            --http-proxy-temp-path=/var/cache/$INSTANCE/proxy_temp \
            --http-fastcgi-temp-path=/var/cache/$INSTANCE/fastcgi_temp \
            --http-uwsgi-temp-path=/var/cache/$INSTANCE/uwsgi_temp \
            --http-scgi-temp-path=/var/cache/$INSTANCE/scgi_temp \
            --user=www-data \
            --group=www-data \
            --with-ld-opt=-lzmq \
            --add-module=../nginx-push-stream-module \
            --add-module=../nginx-rtmp-module \
            --with-http_ssl_module \
            --with-http_v2_module \
            --with-http_realip_module \
            --with-http_sub_module \
            --with-http_secure_link_module \
            --with-http_stub_status_module \
            --with-stream \
            --with-stream=dynamic \
            --with-stream_ssl_module \
            --with-stream_realip_module \
            --with-cc-opt='-Wno-error=implicit-fallthrough' \
         && make -j 8 \
         && strip objs/nginx \
         && echo `pwd`/objs/nginx

COPY start.sh /start.sh
CMD ["sh", "/start.sh"]

我认为这是因为我使用了带有docker-compose的卷,但是如果我没有使用一些卷来构建容器,我会得到同样的错误。

我也不知道如何在没有缓存的情况下重建容器。我试图停止并对容器执行rm操作,但当我尝试重新构建它时,docker只使用缓存

EN

回答 1

Stack Overflow用户

发布于 2020-05-20 01:01:53

答案是我忘记执行了"make install“命令

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61894368

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档