【发布时间】:2015-03-04 19:26:21
【问题描述】:
我正在尝试使用模块 ngx_http_auth_request_module 构建一个用于安装 nginx 的 nginx 映像。
这是我当前的 docker 文件:
#ubuntu OS
FROM ubuntu:14.04
#update apt-get non interactive and install nginx
RUN \
sudo apt-get -q -y update; \
sudo apt-get -q -y install nginx
#copy all mapping configurations for all environments
COPY ./resources/routing-configs/* /routing-configs/
#expose port for nginx
EXPOSE 80
#run task to copy only relevant mapping configuration to nginx and reload nginx service
COPY ./resources/start.sh /opt/mysite/router/start.sh
RUN sudo chmod 766 /opt/mysite/router/start.sh
CMD sudo -E sh /opt/mysite/router/start.sh
通常我会像这样在本地编译 nginx 文件:
sudo ./configure --with-http_auth_request_module
然后安装nginx
sudo make install
但是我如何使用 docker 文件来做到这一点?
请帮忙
【问题讨论】:
-
在 Dockerfile 中使用“sudo”通常是不必要的,因为一切(默认情况下)都以 root 身份运行。
-
是的,我知道,但这与我的问题有什么关系?
-
这只是一般建议。至于您的问题,究竟是什么阻止您在 Dockerfile 中执行
./configure和make?
标签: docker boot2docker dockerfile