From df03606ba4b583eb94e4e0ba77662f6c999f5ec9 Mon Sep 17 00:00:00 2001 From: Li Qiang Lin Date: Wed, 29 Aug 2018 10:22:44 +0800 Subject: [PATCH] Add dockerfile for openresty (#32) --- docker/openresty/1.11.2.4/alpine/Dockerfile | 95 ++++++++++++++++ .../1.11.2.4/alpine/Dockerfile.ppc64le | 28 +++++ .../1.11.2.4/alpine/Dockerfile.s390x | 98 ++++++++++++++++ docker/openresty/1.11.2.4/centos/Dockerfile | 103 +++++++++++++++++ docker/openresty/1.11.2.4/xenial/Dockerfile | 107 ++++++++++++++++++ .../1.11.2.4/xenial/Dockerfile.s390x | 97 ++++++++++++++++ 6 files changed, 528 insertions(+) create mode 100644 docker/openresty/1.11.2.4/alpine/Dockerfile create mode 100644 docker/openresty/1.11.2.4/alpine/Dockerfile.ppc64le create mode 100644 docker/openresty/1.11.2.4/alpine/Dockerfile.s390x create mode 100644 docker/openresty/1.11.2.4/centos/Dockerfile create mode 100644 docker/openresty/1.11.2.4/xenial/Dockerfile create mode 100644 docker/openresty/1.11.2.4/xenial/Dockerfile.s390x diff --git a/docker/openresty/1.11.2.4/alpine/Dockerfile b/docker/openresty/1.11.2.4/alpine/Dockerfile new file mode 100644 index 0000000000..e8b84329f0 --- /dev/null +++ b/docker/openresty/1.11.2.4/alpine/Dockerfile @@ -0,0 +1,95 @@ +# Dockerfile - alpine +# https://github.com/openresty/docker-openresty + +FROM alpine:latest + +MAINTAINER Evan Wies + +# Docker Build Arguments +ARG RESTY_VERSION="1.11.2.4" +ARG RESTY_OPENSSL_VERSION="1.0.2k" +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 \ + " + +# These are not intended to be user-specified +ARG _RESTY_CONFIG_DEPS="--with-openssl=/tmp/openssl-${RESTY_OPENSSL_VERSION} --with-pcre=/tmp/pcre-${RESTY_PCRE_VERSION}" + + +# 1) Install apk dependencies +# 2) Download and untar OpenSSL, PCRE, and OpenResty +# 3) Build OpenResty +# 4) Cleanup + +RUN \ + apk add --no-cache --virtual .build-deps \ + build-base \ + curl \ + gd-dev \ + geoip-dev \ + libxslt-dev \ + linux-headers \ + make \ + perl-dev \ + readline-dev \ + zlib-dev \ + && apk add --no-cache \ + gd \ + geoip \ + libgcc \ + libxslt \ + zlib \ + && 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} \ + && apk del .build-deps \ + && 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/ + +ENTRYPOINT ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"] diff --git a/docker/openresty/1.11.2.4/alpine/Dockerfile.ppc64le b/docker/openresty/1.11.2.4/alpine/Dockerfile.ppc64le new file mode 100644 index 0000000000..bae47921ba --- /dev/null +++ b/docker/openresty/1.11.2.4/alpine/Dockerfile.ppc64le @@ -0,0 +1,28 @@ +FROM ppc64le/alpine:3.6 + +ARG RESTY_VERSION="1.11.2.4" +ARG RESTY_OPENSSL_VERSION="1.0.2k" +ARG RESTY_PCRE_VERSION="8.38" + +RUN apk add --no-cache --virtual .build-deps build-base curl gd-dev geoip-dev libxslt-dev linux-headers make perl-dev readline-dev zlib-dev git file \ + && apk add --no-cache gd geoip libgcc libxslt zlib \ + && 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} \ + && rm -rf bundle/LuaJIT-2.1-20170405 \ + && git clone git://github.com/PPC64/LuaJIT.git bundle/LuaJIT-2.1-20170405 \ + && ./configure --prefix=/opt/ibm/router --with-ipv6 --with-http_gunzip_module --with-http_gzip_static_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_ssl_module --with-luajit --with-openssl=/tmp/openssl-${RESTY_OPENSSL_VERSION} --with-pcre=/tmp/pcre-${RESTY_PCRE_VERSION} \ + && make \ + && make 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} \ + && apk del .build-deps \ + && rm -rf /var/cache/apk/* diff --git a/docker/openresty/1.11.2.4/alpine/Dockerfile.s390x b/docker/openresty/1.11.2.4/alpine/Dockerfile.s390x new file mode 100644 index 0000000000..512c9740f4 --- /dev/null +++ b/docker/openresty/1.11.2.4/alpine/Dockerfile.s390x @@ -0,0 +1,98 @@ +# Dockerfile - alpine +# https://github.com/openresty/docker-openresty + +FROM s390x/alpine:latest + +MAINTAINER Evan Wies + +# Docker Build Arguments +ARG RESTY_VERSION="1.11.2.4" +ARG RESTY_OPENSSL_VERSION="1.0.2k" +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 \ + " + +# These are not intended to be user-specified +ARG _RESTY_CONFIG_DEPS="--with-openssl=/tmp/openssl-${RESTY_OPENSSL_VERSION} --with-pcre=/tmp/pcre-${RESTY_PCRE_VERSION}" + + +# 1) Install apk dependencies +# 2) Download and untar OpenSSL, PCRE, and OpenResty +# 3) Build OpenResty +# 4) Cleanup + +COPY openresty-${RESTY_VERSION} /tmp/openresty-${RESTY_VERSION} + +RUN \ + apk add --no-cache --virtual .build-deps \ + build-base \ + curl \ + gd-dev \ + geoip-dev \ + libxslt-dev \ + linux-headers \ + make \ + perl-dev \ + readline-dev \ + zlib-dev \ + git \ + && apk add --no-cache \ + gd \ + geoip \ + libgcc \ + libxslt \ + zlib \ + && 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 \ + && cd /tmp/openresty-${RESTY_VERSION} \ + && rm -rf bundle/LuaJIT-2.1-20170405 \ + && git clone -b v2.1 https://github.com/linux-on-ibm-z/LuaJIT.git bundle/LuaJIT-2.1-20170405 \ + && ./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} \ + && apk del .build-deps \ + && 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/ + +ENTRYPOINT ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"] diff --git a/docker/openresty/1.11.2.4/centos/Dockerfile b/docker/openresty/1.11.2.4/centos/Dockerfile new file mode 100644 index 0000000000..489bd91dc9 --- /dev/null +++ b/docker/openresty/1.11.2.4/centos/Dockerfile @@ -0,0 +1,103 @@ +# Dockerfile - CentOS 7 +# https://github.com/openresty/docker-openresty + +FROM centos:7 + +MAINTAINER Evan Wies + +# Docker Build Arguments +ARG RESTY_VERSION="1.11.2.4" +ARG RESTY_LUAROCKS_VERSION="2.3.0" +ARG RESTY_OPENSSL_VERSION="1.0.2k" +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 \ + " + +# These are not intended to be user-specified +ARG _RESTY_CONFIG_DEPS="--with-openssl=/tmp/openssl-${RESTY_OPENSSL_VERSION} --with-pcre=/tmp/pcre-${RESTY_PCRE_VERSION}" + + +# 1) Install yum dependencies +# 2) Download and untar OpenSSL, PCRE, and OpenResty +# 3) Build OpenResty +# 4) Cleanup + +RUN \ + yum install -y \ + gcc \ + gcc-c++ \ + gd-devel \ + GeoIP-devel \ + libxslt-devel \ + make \ + perl \ + perl-ExtUtils-Embed \ + readline-devel \ + unzip \ + zlib-devel \ + && 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 \ + && yum clean all \ + && 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/ + +ENTRYPOINT ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"] diff --git a/docker/openresty/1.11.2.4/xenial/Dockerfile b/docker/openresty/1.11.2.4/xenial/Dockerfile new file mode 100644 index 0000000000..c6267c7a5a --- /dev/null +++ b/docker/openresty/1.11.2.4/xenial/Dockerfile @@ -0,0 +1,107 @@ +# Dockerfile - Ubuntu Xenial +# https://github.com/openresty/docker-openresty + +FROM ubuntu:xenial + +MAINTAINER Evan Wies + +# Docker Build Arguments +ARG RESTY_VERSION="1.11.2.4" +ARG RESTY_LUAROCKS_VERSION="2.3.0" +ARG RESTY_OPENSSL_VERSION="1.0.2k" +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 \ + " + +# These are not intended to be user-specified +ARG _RESTY_CONFIG_DEPS="--with-openssl=/tmp/openssl-${RESTY_OPENSSL_VERSION} --with-pcre=/tmp/pcre-${RESTY_PCRE_VERSION}" + + +# 1) Install apt dependencies +# 2) Download and untar OpenSSL, PCRE, and OpenResty +# 3) Build OpenResty +# 4) Cleanup + +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;"] diff --git a/docker/openresty/1.11.2.4/xenial/Dockerfile.s390x b/docker/openresty/1.11.2.4/xenial/Dockerfile.s390x new file mode 100644 index 0000000000..b1c3da08ae --- /dev/null +++ b/docker/openresty/1.11.2.4/xenial/Dockerfile.s390x @@ -0,0 +1,97 @@ +# Dockerfile - Ubuntu Xenial +# https://github.com/openresty/docker-openresty + +FROM ubuntu:xenial + +MAINTAINER Evan Wies + +# Docker Build Arguments +ARG RESTY_VERSION="1.11.2.4" +ARG RESTY_LUAROCKS_VERSION="2.3.0" +ARG RESTY_OPENSSL_VERSION="1.0.2k" +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 \ + " + +# These are not intended to be user-specified +ARG _RESTY_CONFIG_DEPS="--with-openssl=/tmp/openssl-${RESTY_OPENSSL_VERSION} --with-pcre=/tmp/pcre-${RESTY_PCRE_VERSION}" + +COPY openresty-${RESTY_VERSION} /tmp/openresty-${RESTY_VERSION} + +# 1) Install apt dependencies +# 2) Download and untar OpenSSL, PCRE, and OpenResty +# 3) Build OpenResty +# 4) Cleanup + +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 \ + git \ + 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 \ + && cd /tmp/openresty-${RESTY_VERSION} \ + && rm -rf bundle/LuaJIT-2.1-20170405 \ + && git clone -b v2.1 https://github.com/linux-on-ibm-z/LuaJIT.git bundle/LuaJIT-2.1-20170405 \ + && ./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} \ + && 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;"]