Skip to content

Commit e5ea8a3

Browse files
committed
Moved to a different repository layout.
This scheme allows to enable builds for various distributions and both stable and mainline nginx versions. Closes: nginx#62, nginx#63, incorporating work of Natanael Copa <ncopa@alpinelinux.org>. Closes: nginx#66.
1 parent e82e776 commit e5ea8a3

File tree

22 files changed

+467
-0
lines changed

22 files changed

+467
-0
lines changed

mainline/alpine/Dockerfile

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
FROM alpine:latest
2+
3+
MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com"
4+
5+
ENV NGINX_VERSION 1.9.11
6+
7+
ENV GPG_KEYS B0F4253373F8F6F510D42178520A9993A1C052F8
8+
ENV CONFIG "\
9+
--prefix=/etc/nginx \
10+
--sbin-path=/usr/sbin/nginx \
11+
--conf-path=/etc/nginx/nginx.conf \
12+
--error-log-path=/var/log/nginx/error.log \
13+
--http-log-path=/var/log/nginx/access.log \
14+
--pid-path=/var/run/nginx.pid \
15+
--lock-path=/var/run/nginx.lock \
16+
--http-client-body-temp-path=/var/cache/nginx/client_temp \
17+
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
18+
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
19+
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
20+
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
21+
--user=nginx \
22+
--group=nginx \
23+
--with-http_ssl_module \
24+
--with-http_realip_module \
25+
--with-http_addition_module \
26+
--with-http_sub_module \
27+
--with-http_dav_module \
28+
--with-http_flv_module \
29+
--with-http_mp4_module \
30+
--with-http_gunzip_module \
31+
--with-http_gzip_static_module \
32+
--with-http_random_index_module \
33+
--with-http_secure_link_module \
34+
--with-http_stub_status_module \
35+
--with-http_auth_request_module \
36+
--with-threads \
37+
--with-stream \
38+
--with-stream_ssl_module \
39+
--with-http_slice_module \
40+
--with-mail \
41+
--with-mail_ssl_module \
42+
--with-file-aio \
43+
--with-http_v2_module \
44+
--with-ipv6 \
45+
"
46+
47+
RUN \
48+
addgroup -S nginx \
49+
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
50+
&& apk add --no-cache --virtual .build-deps \
51+
gcc \
52+
libc-dev \
53+
make \
54+
openssl-dev \
55+
pcre-dev \
56+
zlib-dev \
57+
linux-headers \
58+
curl \
59+
gnupg \
60+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEYS" \
61+
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
62+
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
63+
&& gpg --verify nginx.tar.gz.asc \
64+
&& mkdir -p /usr/src \
65+
&& tar -zxC /usr/src -f nginx.tar.gz \
66+
&& rm nginx.tar.gz* \
67+
&& rm -r /root/.gnupg \
68+
&& cd /usr/src/nginx-$NGINX_VERSION \
69+
&& ./configure $CONFIG --with-debug \
70+
&& make \
71+
&& mv objs/nginx objs/nginx-debug \
72+
&& ./configure $CONFIG \
73+
&& make \
74+
&& make install \
75+
&& install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
76+
&& strip /usr/sbin/nginx* \
77+
&& runDeps="$( \
78+
scanelf --needed --nobanner /usr/sbin/nginx \
79+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
80+
| sort -u \
81+
| xargs -r apk info --installed \
82+
| sort -u \
83+
)" \
84+
&& apk add --virtual .nginx-rundeps $runDeps \
85+
&& apk del .build-deps \
86+
&& rm -rf /usr/src/nginx-* \
87+
\
88+
# forward request and error logs to docker log collector
89+
&& ln -sf /dev/stdout /var/log/nginx/access.log \
90+
&& ln -sf /dev/stderr /var/log/nginx/error.log
91+
92+
EXPOSE 80 443
93+
94+
CMD ["nginx", "-g", "daemon off;"]

mainline/centos5/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM centos:5
2+
3+
MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com"
4+
5+
ENV NGINX_VERSION 1.9.11-1.el5.ngx
6+
7+
COPY ./nginx.repo /etc/yum.repos.d/nginx.repo
8+
9+
RUN rpm --import http://nginx.org/keys/nginx_signing.key \
10+
&& yum install -y openssl nginx-${NGINX_VERSION} gettext \
11+
&& yum clean all
12+
13+
# forward request and error logs to docker log collector
14+
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
15+
&& ln -sf /dev/stderr /var/log/nginx/error.log
16+
17+
EXPOSE 80 443
18+
19+
CMD ["nginx", "-g", "daemon off;"]

mainline/centos5/nginx.repo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[nginx]
2+
name=nginx repo
3+
baseurl=http://nginx.org/packages/mainline/centos/5/$basearch/
4+
gpgcheck=1
5+
repogpgcheck=1
6+
enabled=1

mainline/centos6/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM centos:6
2+
3+
MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com"
4+
5+
ENV NGINX_VERSION 1.9.11-1.el6.ngx
6+
7+
COPY ./nginx.repo /etc/yum.repos.d/nginx.repo
8+
9+
RUN rpm --import http://nginx.org/keys/nginx_signing.key \
10+
&& yum install -y ca-certificates nginx-${NGINX_VERSION} gettext \
11+
&& yum clean all
12+
13+
# forward request and error logs to docker log collector
14+
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
15+
&& ln -sf /dev/stderr /var/log/nginx/error.log
16+
17+
EXPOSE 80 443
18+
19+
CMD ["nginx", "-g", "daemon off;"]

mainline/centos6/nginx.repo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[nginx]
2+
name=nginx repo
3+
baseurl=http://nginx.org/packages/mainline/centos/6/$basearch/
4+
gpgcheck=1
5+
repogpgcheck=1
6+
enabled=1

mainline/centos7/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM centos:7
2+
3+
MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com"
4+
5+
ENV NGINX_VERSION 1.9.11-1.el7.ngx
6+
7+
COPY ./nginx.repo /etc/yum.repos.d/nginx.repo
8+
9+
RUN rpm --import http://nginx.org/keys/nginx_signing.key \
10+
&& yum install -y ca-certificates nginx-${NGINX_VERSION} gettext \
11+
&& yum clean all
12+
13+
# forward request and error logs to docker log collector
14+
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
15+
&& ln -sf /dev/stderr /var/log/nginx/error.log
16+
17+
EXPOSE 80 443
18+
19+
CMD ["nginx", "-g", "daemon off;"]

mainline/centos7/nginx.repo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[nginx]
2+
name=nginx repo
3+
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
4+
gpgcheck=1
5+
repogpgcheck=1
6+
enabled=1
File renamed without changes.

mainline/precise/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:precise
2+
3+
MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com"
4+
5+
ENV NGINX_VERSION 1.9.11-1~precise
6+
7+
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
8+
&& echo "deb http://nginx.org/packages/mainline/ubuntu/ precise nginx" >> /etc/apt/sources.list \
9+
&& apt-get update \
10+
&& apt-get install -y ca-certificates nginx=${NGINX_VERSION} gettext-base \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# forward request and error logs to docker log collector
14+
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
15+
&& ln -sf /dev/stderr /var/log/nginx/error.log
16+
17+
EXPOSE 80 443
18+
19+
CMD ["nginx", "-g", "daemon off;"]

mainline/trusty/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:trusty
2+
3+
MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com"
4+
5+
ENV NGINX_VERSION 1.9.11-1~trusty
6+
7+
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
8+
&& echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" >> /etc/apt/sources.list \
9+
&& apt-get update \
10+
&& apt-get install -y ca-certificates nginx=${NGINX_VERSION} gettext-base \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# forward request and error logs to docker log collector
14+
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
15+
&& ln -sf /dev/stderr /var/log/nginx/error.log
16+
17+
EXPOSE 80 443
18+
19+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)