-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (67 loc) · 2.66 KB
/
Dockerfile
File metadata and controls
74 lines (67 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
ARG ubuntu_version='22.04'
FROM ubuntu:${ubuntu_version}
ENV DEBIAN_FRONTEND noninteractive
ARG ubuntu_codename='jammy'
RUN apt-get update && \
apt-get install -y \
dpkg-dev \
devscripts \
build-essential \
fakeroot \
debhelper \
libssl-dev \
libpcre3-dev \
zlib1g-dev \
quilt \
curl \
git \
wget \
gettext-base
RUN cd /etc/apt/sources.list.d/ && \
echo "deb http://nginx.org/packages/ubuntu/ ${ubuntu_codename} nginx" >> nginx.list && \
echo "deb-src http://nginx.org/packages/ubuntu/ ${ubuntu_codename} nginx" >> nginx.list && \
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add - && \
apt-get update
RUN apt-get build-dep nginx -y
ARG vts_version='v0.2.2'
RUN mkdir /root/modules && \
cd /root/modules && \
git clone https://github.com/vozlt/nginx-module-vts.git && \
mv nginx-module-vts nginx-module-vts-${vts_version} && \
cd nginx-module-vts-${vts_version} && \
git checkout ${vts_version}
COPY ./template_changelog ./root/template_changelog
COPY ./version_count ./root/version_count
WORKDIR /root
RUN \
export version_count=`cat ./version_count` && \
export nginx_deb_version=`apt-cache policy nginx | grep "Version table:" -A1 | tail -n1 | awk '{ print $1 }'` && \
apt-get source nginx=${nginx_deb_version} && \
nginx_dir=`ls -d ./nginx-*` && \
echo nginx_dir=${nginx_dir} && \
sed -i "s@--with-stream_ssl_preread_module@--with-stream_ssl_preread_module --add-module=/root/modules/nginx-module-vts-${vts_version}@" ./${nginx_dir}/debian/rules && \
export nginx_version="${nginx_deb_version}~vts-${vts_version}~${version_count}" && \
export date_time="`date -R`" && \
cat ./template_changelog | envsubst > 1 && \
cp ./${nginx_dir}/debian/changelog ./changelog1 && \
cat 1 ./changelog1 > ./${nginx_dir}/debian/changelog && \
cat 1 ./changelog1 > ./changelog && \
cat ./changelog
ARG custom_ssl=false
ARG openssl_version="1.1.1f"
ARG openssl="openssl-${openssl_version}"
ARG openssl_url="https://www.openssl.org/source/old/${openssl_version}/${openssl}.tar.gz"
RUN if [ ${custom_ssl} = 'true' ]; then \
cd /root && \
wget ${openssl_url} && \
gzip -d ${openssl}.tar.gz -c | tar -x && \
sed -i "s@./configure --prefix@./configure --with-openssl=/root/${openssl} --with-openssl-opt='no-ssl2 no-ssl3 -fPIC' --prefix@g" ./nginx-${nginx_version}/debian/rules; \
fi;
RUN \
nginx_dir=`ls -d ./nginx-*` && \
cd ${nginx_dir} && \
debuild -b -uc -us && \
cd .. && \
mkdir package && \
deb=`ls -1 ./*.deb | grep -v dbg_` && \
cp ./${deb} ./package/