/docker-openresty-brotli

OpenResty docker Image with brotli support

Primary LanguageDockerfileBSD 2-Clause "Simplified" LicenseBSD-2-Clause

docker-openresty-brotli - Docker tooling for OpenResty(with brotli support)

docker-openresty is Docker tooling for OpenResty (https://www.openresty.org).

Docker is a container management platform. OpenResty is a full-fledged web application server by bundling the standard nginx core, lots of 3rd-party nginx modules, as well as most of their external dependencies(brotli included).

The built-from-source flavors include the following modules by default, but one can easily increase or decrease that with the custom build options above:

  • file-aio
  • http_addition_module
  • http_auth_request_module
  • http_dav_module
  • http_flv_module
  • http_geoip_module=dynamic
  • http_gunzip_module
  • http_gzip_static_module
  • http_image_filter_module=dynamic
  • http_mp4_module
  • http_random_index_module
  • http_realip_module
  • http_secure_link_module
  • http_slice_module
  • http_ssl_module
  • http_stub_status_module
  • http_sub_module
  • http_v2_module
  • http_xslt_module=dynamic
  • ipv6
  • mail
  • mail_ssl_module
  • md5-asm
  • pcre-jit
  • sha1-asm
  • stream
  • stream_ssl_module
  • threads
  • ngx_brotli

Usage

If you are happy to go with prebuilt one, get image from the dockerhub, or just build it yourself.

Building (from source)

This Docker image can be built and customized by cloning the repo and running docker build with the Dockerfile(only ubuntu focal is supported now):

git clone https://github.com/Sped0n/docker-openresty-brotli.git
cd docker-openresty-brotli
docker build -t myopenresty -f focal/Dockerfile .
docker run myopenresty

Dockerfiles are provided for the following base systems, selecting the Dockerfile path with -f:

The following are the available build-time options. They can be set using the --build-arg CLI argument, like so:

docker build --build-arg RESTY_J=4 -f focal/Dockerfile .
Key Default Description
RESTY_IMAGE_BASE "ubuntu" / "alpine" The Debian or Alpine Docker image base to build FROM.
RESTY_IMAGE_TAG "jammy" / "3.18" The Debian or Alpine Docker image tag to build FROM.
RESTY_VERSION 1.21.4.2 The version of OpenResty to use.
RESTY_LUAROCKS_VERSION 3.9.2 The version of LuaRocks to use.
RESTY_OPENSSL_VERSION 1.1.1u The version of OpenSSL to use.
RESTY_OPENSSL_PATCH_VERSION 1.1.1f The version of OpenSSL to use when patching.
RESTY_OPENSSL_URL_BASE https://www.openssl.org/source The base of the URL to download OpenSSL from.
RESTY_PCRE_VERSION 8.45 The version of PCRE to use.
RESTY_PCRE_SHA256 4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 The SHA-256 checksum of the PCRE package to check.
RESTY_PCRE_BUILD_OPTIONS "--enable-jit" Options tweak Resty's PCRE build.
RESTY_PCRE_OPTIONS "--with-pcre-jit" Options to tweak Resty's build args regarding PCRE.
RESTY_J 1 Sets the parallelism level (-jN) for the builds.
RESTY_CONFIG_OPTIONS "--with-compat --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_perl_module=dynamic --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" Options to pass to OpenResty's ./configure script.
RESTY_LUAJIT_OPTIONS "--with-luajit-xcflags='-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT'" Options to tweak LuaJIT.
RESTY_CONFIG_OPTIONS_MORE "" More options to pass to OpenResty's ./configure script.
RESTY_ADD_PACKAGE_BUILDDEPS "" Additional packages to install with package manager required by build only (removed after installation)
RESTY_ADD_PACKAGE_RUNDEPS "" Additional packages to install with package manager required at runtime (not removed after installation)
RESTY_EVAL_PRE_CONFIGURE "" Command(s) to run prior to executing OpenResty's ./configure script. (this can be used to clone a github repo of an extension you want to add to OpenResty, for example. In that case, dont forget to add the appropriate argument to the RESTY_CONFIG_OPTIONS_MORE argument as described above).
RESTY_EVAL_POST_DOWNLOAD_PRE_CONFIGURE "" Command(s) to run after downloading and extracting OpenResty's source tarball, but prior to executing OpenResty's ./configure script. Working directory will be the extracted OpenResty source directory.
RESTY_EVAL_POST_MAKE "" Command(s) to run after running make install.