Last active
April 13, 2017 23:38
-
-
Save sentient/ef5248da326da73189a3c0fac9052bbc to your computer and use it in GitHub Desktop.
Nvidia docker (cuda) / Torch / Lua / OpenResty / Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nvidia/cuda:8.0-devel-ubuntu16.04 | |
ARG RESTY_VERSION="1.11.2.2" | |
ARG RESTY_LUAROCKS_VERSION="2.3.0" | |
ARG RESTY_OPENSSL_VERSION="1.0.2j" | |
ARG RESTY_PCRE_VERSION="8.39" | |
ARG RESTY_J="1" | |
ARG RESTY_CONFIG_OPTIONS="\ | |
--with-file-aio \ | |
--with-http_addition_module \ | |
--with-http_auth_request_module \ | |
--with-http_dav_module \ | |
--with-http_flv_module \ | |
--with-http_geoip_module=dynamic \ | |
--with-http_gunzip_module \ | |
--with-http_gzip_static_module \ | |
--with-http_image_filter_module=dynamic \ | |
--with-http_mp4_module \ | |
--with-http_random_index_module \ | |
--with-http_realip_module \ | |
--with-http_secure_link_module \ | |
--with-http_slice_module \ | |
--with-http_ssl_module \ | |
--with-http_stub_status_module \ | |
--with-http_sub_module \ | |
--with-http_v2_module \ | |
--with-http_xslt_module=dynamic \ | |
--with-ipv6 \ | |
--with-mail \ | |
--with-mail_ssl_module \ | |
--with-md5-asm \ | |
--with-pcre-jit \ | |
--with-sha1-asm \ | |
--with-stream \ | |
--with-stream_ssl_module \ | |
--with-threads \ | |
" | |
RUN \ | |
DEBIAN_FRONTEND=noninteractive apt-get update \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | |
build-essential \ | |
ca-certificates \ | |
curl \ | |
libgd-dev \ | |
libgeoip-dev \ | |
libncurses5-dev \ | |
libperl-dev \ | |
libreadline-dev \ | |
libxslt1-dev \ | |
make \ | |
perl \ | |
unzip \ | |
zlib1g-dev \ | |
&& cd /tmp \ | |
&& curl -fSL https://www.openssl.org/source/openssl-${RESTY_OPENSSL_VERSION}.tar.gz -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ | |
&& tar xzf openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ | |
&& curl -fSL https://ftp.pcre.org/pub/pcre/pcre-${RESTY_PCRE_VERSION}.tar.gz -o pcre-${RESTY_PCRE_VERSION}.tar.gz \ | |
&& tar xzf pcre-${RESTY_PCRE_VERSION}.tar.gz \ | |
&& curl -fSL https://openresty.org/download/openresty-${RESTY_VERSION}.tar.gz -o openresty-${RESTY_VERSION}.tar.gz \ | |
&& tar xzf openresty-${RESTY_VERSION}.tar.gz \ | |
&& cd /tmp/openresty-${RESTY_VERSION} \ | |
&& ./configure -j${RESTY_J} ${_RESTY_CONFIG_DEPS} ${RESTY_CONFIG_OPTIONS} \ | |
&& make -j${RESTY_J} \ | |
&& make -j${RESTY_J} install \ | |
&& cd /tmp \ | |
&& rm -rf \ | |
openssl-${RESTY_OPENSSL_VERSION} \ | |
openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ | |
openresty-${RESTY_VERSION}.tar.gz openresty-${RESTY_VERSION} \ | |
pcre-${RESTY_PCRE_VERSION}.tar.gz pcre-${RESTY_PCRE_VERSION} \ | |
&& curl -fSL http://luarocks.org/releases/luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ | |
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ | |
&& cd luarocks-${RESTY_LUAROCKS_VERSION} \ | |
&& ./configure \ | |
--prefix=/usr/local/openresty/luajit \ | |
--with-lua=/usr/local/openresty/luajit \ | |
--lua-suffix=jit-2.1.0-beta2 \ | |
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \ | |
&& make build \ | |
&& make install \ | |
&& cd /tmp \ | |
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get autoremove -y \ | |
&& ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \ | |
&& ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log | |
# Add additional binaries into PATH for convenience | |
ENV PATH=$PATH:/usr/local/openresty/luajit/bin/:/usr/local/openresty/nginx/sbin/:/usr/local/openresty/bin/ | |
# TODO: remove any other apt packages? | |
ENTRYPOINT ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment