Skip to content
This repository was archived by the owner on Jan 11, 2025. It is now read-only.

Commit 2a0a0d4

Browse files
updated readme + fixed CFLAGS & LDOPT env vars
1 parent 52dba08 commit 2a0a0d4

File tree

14 files changed

+97
-51
lines changed

14 files changed

+97
-51
lines changed

README.md

+47-47
Large diffs are not rendered by default.

nginx/1.19.3/alpine/3.12.1/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX=1.19.3
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

nginx/1.19.3/amazonlinux/2.0.20200722.0/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX=1.19.3
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

nginx/1.19.3/centos/8/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX=1.19.3
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

nginx/1.19.3/debian/10.6/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX=1.19.3
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

nginx/1.19.3/fedora/33/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX=1.19.3
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

nginx/1.19.3/ubuntu/20.04/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX=1.19.3
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

tpl/Dockerfile.alpine

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX={{VER_NGINX}}
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

tpl/Dockerfile.amazonlinux

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX={{VER_NGINX}}
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

tpl/Dockerfile.centos

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX={{VER_NGINX}}
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

tpl/Dockerfile.debian

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX={{VER_NGINX}}
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

tpl/Dockerfile.fedora

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX={{VER_NGINX}}
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

tpl/Dockerfile.ubuntu

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ ENV VER_OPENRESTY_STREAMLUA=$VER_OPENRESTY_STREAMLUA
118118
# https://github.com/nginx/nginx/releases
119119
ARG VER_NGINX={{VER_NGINX}}
120120
ENV VER_NGINX=$VER_NGINX
121+
ARG NGX_CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
122+
ENV NGX_CFLAGS=$NGX_CFLAGS
123+
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
124+
ENV NGX_LDOPT=$NGX_LDOPT
121125
ARG NGINX_BUILD_CONFIG="\
122126
--prefix=/etc/nginx \
123127
--sbin-path=/usr/sbin/nginx \

tpl/Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ core:
1616
/var/cache/nginx/fastcgi_temp \
1717
/var/cache/nginx/uwsgi_temp \
1818
/var/cache/nginx/scgi_temp
19-
CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
20-
LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
2119
cd /nginx-${VER_NGINX} \
22-
&& ./configure ${NGINX_BUILD_CONFIG} --with-cc-opt="$(CFLAGS)" --with-ld-opt="$(LDOPT)" --with-debug \
20+
&& ./configure ${NGINX_BUILD_CONFIG} --with-cc-opt="$(NGX_CFLAGS)" --with-ld-opt="$(NGX_LDOPT)" --with-debug \
2321
&& make -j $(NPROC) build \
2422
&& mv objs/nginx objs/nginx-debug \
25-
&& ./configure ${NGINX_BUILD_CONFIG} --with-cc-opt="$(CFLAGS)" --with-ld-opt="$(LDOPT)" \
23+
&& ./configure ${NGINX_BUILD_CONFIG} --with-cc-opt="$(NGX_CFLAGS)" --with-ld-opt="$(NGX_LDOPT)" \
2624
&& make -j $(NPROC) build \
2725
&& make -j $(NPROC) modules \
2826
&& install -m755 objs/nginx-debug /usr/sbin/nginx-debug \

0 commit comments

Comments
 (0)