Dependency Hell
Avoiding building from source when you can
FROM debian:stable
# FROM debian:slim-bullseye to save some bytes
# Update the package repository and install the necessary dependencies
RUN apt-get update && apt-get install -y \
build-essential \
wget \
git \
curl \
zlib1g-dev \
libpcre3-dev \
libpcre2-dev \
libssl-dev \
llvm-dev \
libclang-dev \
clang \
automake \
autoconf \
libtool \
vim
# Download Nginx source code
WORKDIR /nginx
ENV NGINX_VER=1.14.2
RUN git config --global http.sslVerify false
RUN wget --no-check-certificate https://nginx.org/download/nginx-${NGINX_VER}.tar.gz
RUN tar -xzvf nginx-${NGINX_VER}.tar.gz
RUN rm nginx-${NGINX_VER}.tar.gz
# Configure and compile Nginx with dynamic module support
WORKDIR /nginx/nginx-${NGINX_VER}
RUN ./configure --with-compat
RUN make
RUN make install
RUN cp objs/nginx /usr/sbin/nginx
# default dynamic modules directory
RUN mkdir /usr/local/nginx/modules
EXPOSE 80
# Start Nginx
# Define the ENTRYPOINT as the NGINX executable
ENTRYPOINT ["nginx", "-g", "daemon off;"]Last updated