|
| 1 | +FROM debian:jessie |
| 2 | + |
| 3 | +# see http://nginx.org/en/pgp_keys.html |
| 4 | +RUN gpg --keyserver pgp.mit.edu --recv-key \ |
| 5 | + A09CD539B8BB8CBE96E82BDFABD4D3B3F5806B4D \ |
| 6 | + 4C2C85E705DC730833990C38A9376139A524C53E \ |
| 7 | + B0F4253373F8F6F510D42178520A9993A1C052F8 \ |
| 8 | + 65506C02EFC250F1B7A3D694ECF0E90B2C172083 \ |
| 9 | + 7338973069ED3F443F4D37DFA64FD5B17ADB39A8 \ |
| 10 | + 6E067260B83DCF2CA93C566F518509686C7E5E82 \ |
| 11 | + 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 |
| 12 | + |
| 13 | +ENV NGINX_VERSION 1.7.4 |
| 14 | + |
| 15 | +# All our runtime and build dependencies, in alphabetical order (to ease maintenance) |
| 16 | +RUN runDeps=" \ |
| 17 | + fontconfig-config \ |
| 18 | + fonts-dejavu-core \ |
| 19 | + geoip-database \ |
| 20 | + init-system-helpers \ |
| 21 | + libarchive-extract-perl \ |
| 22 | + libexpat1 \ |
| 23 | + libfontconfig1 \ |
| 24 | + libfreetype6 \ |
| 25 | + libgcrypt11 \ |
| 26 | + libgd3 \ |
| 27 | + libgdbm3 \ |
| 28 | + libgeoip1 \ |
| 29 | + libgpg-error0 \ |
| 30 | + libjbig0 \ |
| 31 | + libjpeg8 \ |
| 32 | + liblog-message-perl \ |
| 33 | + liblog-message-simple-perl \ |
| 34 | + libmodule-pluggable-perl \ |
| 35 | + libpng12-0 \ |
| 36 | + libpod-latex-perl \ |
| 37 | + libssl1.0.0 \ |
| 38 | + libterm-ui-perl \ |
| 39 | + libtext-soundex-perl \ |
| 40 | + libtiff5 \ |
| 41 | + libvpx1 \ |
| 42 | + libx11-6 \ |
| 43 | + libx11-data \ |
| 44 | + libxau6 \ |
| 45 | + libxcb1 \ |
| 46 | + libxdmcp6 \ |
| 47 | + libxml2 \ |
| 48 | + libxpm4 \ |
| 49 | + libxslt1.1 \ |
| 50 | + perl \ |
| 51 | + perl-modules \ |
| 52 | + rename \ |
| 53 | + sgml-base \ |
| 54 | + ucf \ |
| 55 | + xml-core \ |
| 56 | + "; \ |
| 57 | + buildDeps=" \ |
| 58 | + ca-certificates \ |
| 59 | + curl \ |
| 60 | + gcc \ |
| 61 | + libc-dev-bin \ |
| 62 | + libc6-dev \ |
| 63 | + libexpat1-dev \ |
| 64 | + libfontconfig1-dev \ |
| 65 | + libfreetype6-dev \ |
| 66 | + libgd-dev \ |
| 67 | + libgd2-dev \ |
| 68 | + libgeoip-dev \ |
| 69 | + libice-dev \ |
| 70 | + libjbig-dev \ |
| 71 | + libjpeg8-dev \ |
| 72 | + liblzma-dev \ |
| 73 | + libpcre3-dev \ |
| 74 | + libperl-dev \ |
| 75 | + libpng12-dev \ |
| 76 | + libpthread-stubs0-dev \ |
| 77 | + libsm-dev \ |
| 78 | + libssl-dev \ |
| 79 | + libssl-dev \ |
| 80 | + libtiff5-dev \ |
| 81 | + libvpx-dev \ |
| 82 | + libx11-dev \ |
| 83 | + libxau-dev \ |
| 84 | + libxcb1-dev \ |
| 85 | + libxdmcp-dev \ |
| 86 | + libxml2-dev \ |
| 87 | + libxpm-dev \ |
| 88 | + libxslt1-dev \ |
| 89 | + libxt-dev \ |
| 90 | + linux-libc-dev \ |
| 91 | + make \ |
| 92 | + manpages-dev \ |
| 93 | + x11proto-core-dev \ |
| 94 | + x11proto-input-dev \ |
| 95 | + x11proto-kb-dev \ |
| 96 | + xtrans-dev \ |
| 97 | + zlib1g-dev \ |
| 98 | + "; \ |
| 99 | + apt-get update && apt-get install -y --no-install-recommends \ |
| 100 | + $buildDeps\ |
| 101 | + $runDeps \ |
| 102 | + && rm -rf /var/lib/apt/lists/* \ |
| 103 | + && curl -SL "http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz" -o nginx.tar.gz \ |
| 104 | + && curl -SL "http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc" -o nginx.tar.gz.asc \ |
| 105 | + && gpg --verify nginx.tar.gz.asc \ |
| 106 | + && mkdir -p /usr/src/nginx \ |
| 107 | + && tar -xvf nginx.tar.gz -C /usr/src/nginx --strip-components=1 \ |
| 108 | + && rm nginx.tar.gz* \ |
| 109 | + && cd /usr/src/nginx \ |
| 110 | + && ./configure \ |
| 111 | + --user=www-data \ |
| 112 | + --group=www-data \ |
| 113 | + --prefix=/usr/local/nginx \ |
| 114 | + --conf-path=/etc/nginx.conf \ |
| 115 | + --http-log-path=/proc/self/fd/1 \ |
| 116 | + --error-log-path=/proc/self/fd/2 \ |
| 117 | + --with-http_addition_module \ |
| 118 | + --with-http_auth_request_module \ |
| 119 | + --with-http_dav_module \ |
| 120 | + --with-http_geoip_module \ |
| 121 | + --with-http_gzip_static_module \ |
| 122 | + --with-http_image_filter_module \ |
| 123 | + --with-http_perl_module \ |
| 124 | + --with-http_realip_module \ |
| 125 | + --with-http_spdy_module \ |
| 126 | + --with-http_ssl_module \ |
| 127 | + --with-http_stub_status_module \ |
| 128 | + --with-http_sub_module \ |
| 129 | + --with-http_xslt_module \ |
| 130 | + --with-ipv6 \ |
| 131 | + --with-mail \ |
| 132 | + --with-mail_ssl_module \ |
| 133 | + --with-pcre-jit \ |
| 134 | + && make -j"$(nproc)" \ |
| 135 | + && make install \ |
| 136 | + && cd / \ |
| 137 | + && rm -r /usr/src/nginx \ |
| 138 | + && ln -vs ../nginx/sbin/nginx /usr/local/sbin/ \ |
| 139 | + && chown -R www-data:www-data /usr/local/nginx \ |
| 140 | + && { \ |
| 141 | + echo; \ |
| 142 | + echo '# stay in the foreground so Docker has a process to track'; \ |
| 143 | + echo 'daemon off;'; \ |
| 144 | + } >> /etc/nginx.conf \ |
| 145 | + && apt-get purge -y \ |
| 146 | + $buildDeps \ |
| 147 | + && apt-get autoremove -y |
| 148 | + |
| 149 | +WORKDIR /usr/local/nginx/html |
| 150 | + |
| 151 | +EXPOSE 80 |
| 152 | +CMD ["nginx"] |
0 commit comments