M
M
Mark Ivanych2017-10-31 22:59:42
Nginx
Mark Ivanych, 2017-10-31 22:59:42

How to build Nginx from source on docker?

Hello!
This is my first experience with Nginx.
Off. image could not be used, since nginx-vod-module .deb is available only for Debian 8, and Nginx is already on the 9th version. Well, I thought, because of this, the turnip keys were not correct. Failed to install nginx-vod-module.
I decided to file my image from the source:

FROM debian:latest
RUN apt-get update \
&& apt-get -y install gcc \
&& apt-get -y install libpcre3 libpcre3-dev \
&& apt-get -y install zlib1g-dev \
&& apt-get -y install wget \
&& apt-get clean

RUN mkdir -p /nginx && mkdir -p /nginx-vod-module \
&& wget https://nginx.ru/download/nginx-1.12.2.tar.gz && tar -xf nginx-1.12.2.tar.gz -C /nginx --strip-components=1 \
&& wget https://github.com/kaltura/nginx-vod-module/archive/1.20.tar.gz && tar -xf 1.20.tar.gz -C /nginx-vod-module --strip-components=1 \
&& cd /nginx \
&& chmod +x ./configure \
&& ./configure \
&& ./configure --add-module=/nginx-vod-module

Everything seems to be successfully installed:
Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

But there is no such directory /usr/local/nginx
in the container Added and working so far
&& make && make install
EXPOSE 80
CMD [ "/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rustler2000, 2017-10-31
@iormark

After the configuration, actually build and install the necessary;)
make && make install

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question