A high-performance, source-compiled OpenResty Docker image built on Enterprise Linux, featuring additional nginx modules, optimized libraries, and extended Lua libraries for modern web applications and API gateways.
Important: This image requires Enterprise Linux 9 or later as the base OS, including:
- Rocky Linux 9 / 10
- AlmaLinux 9 / 10
- CentOS Stream 9 / 10
- Red Hat Enterprise Linux 9 / 10
EL8 and earlier versions are not supported.
linux/amd64 and linux/arm64 architectures# Pull from Docker Hub
docker pull sungyism/openresty:latest
# Run a basic container
docker run -d --name openresty \
-p 80:80 \
sungyism/openresty:latest
# Verify
curl http://localhost/
docker run -d --name openresty \
-p 80:80 \
-p 443:443 \
sungyism/openresty:latest
docker run -d --name openresty \
-p 80:80 \
-p 443:443 \
-v /path/to/nginx.conf:/etc/nginx/nginx.conf:ro \
-v /path/to/conf.d:/etc/nginx/conf.d:ro \
-v /path/to/certs:/etc/nginx/certs:ro \
-v /path/to/html:/opt/openresty/nginx/html:ro \
sungyism/openresty:latest
version: '3.8'
services:
openresty:
image: sungyism/openresty:latest
container_name: openresty
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./conf.d:/etc/nginx/conf.d:ro
- ./html:/opt/openresty/nginx/html:ro
- ./logs:/var/log/nginx
environment:
- NGINX_ENTRYPOINT_QUIET_LOGS=1
docker build -t openresty:local .
If you are behind a corporate firewall or have network restrictions, you can pass proxy settings:
# Using environment variables (recommended)
docker build \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
--build-arg NO_PROXY=${NO_PROXY} \
-t openresty:local .
# Or with explicit proxy values
docker build \
--build-arg HTTP_PROXY=http://proxy.example.com:8080 \
--build-arg HTTPS_PROXY=http://proxy.example.com:8080 \
--build-arg NO_PROXY=localhost,127.0.0.1,.internal \
-t openresty:local .
# Rocky Linux 10
docker build \
--build-arg BASE_IMAGE=rockylinux/rockylinux:10 \
--build-arg RUNTIME_IMAGE=rockylinux/rockylinux:10-minimal \
-t openresty:local .
# AlmaLinux 9
docker build \
--build-arg BASE_IMAGE=almalinux:9 \
--build-arg RUNTIME_IMAGE=almalinux:9-minimal \
-t openresty:local .
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t openresty:local \
.
| Argument | Default | Description |
|---|---|---|
BASE_IMAGE | rockylinux/rockylinux:9 | Base image for download and build stages |
RUNTIME_IMAGE | rockylinux/rockylinux:9-minimal | Base image for final runtime stage |
HTTP_PROXY | (none) | HTTP proxy for network requests |
HTTPS_PROXY | (none) | HTTPS proxy for network requests |
NO_PROXY | (none) | Hosts to bypass proxy |
OPENRESTY_VER | 1.29.2.2 | OpenResty version |
OPENSSL_VER | 3.5.5 | OpenSSL version |
ZLIB_VER | 1.3.2 | zlib compression library version |
PCRE2_VER | 10.47 | PCRE2 regex library version |
GEOIP_VER | 1.6.12 | Legacy GeoIP library version |
LIBMAXMINDDB_VER | 1.13.3 | MaxMind DB reader library version |
BROTLI_VER | 1.2.0 | Brotli compression library version |
NGX_BROTLI_VER | master | nginx Brotli module version |
NGX_GEOIP2_VER | 3.4 | nginx GeoIP2 module version |
RESTY_EXPR_VER | 1.3.2 | lua-resty-expr version |
RESTY_HTTP_VER | 0.2.3 | lua-resty-http version |
RESTY_IPMATCHER_VER | 0.6.1 | lua-resty-ipmatcher version |
RESTY_RADIXTREE_VER | 2.9.2 | lua-resty-radixtree version |
| Component | Description |
|---|---|
| OpenResty | Full-fledged web platform with LuaJIT |
| LuaJIT | Just-In-Time compiler for Lua with Lua 5.2 compatibility |
| OpenSSL 3.x | TLS/SSL library with OpenResty session yield patch |
| zlib | General-purpose lossless compression library |
| PCRE2 | Perl-compatible regular expressions with JIT enabled |
| Module | Description |
|---|---|
| ngx_brotli | Brotli compression filter module |
| ngx_http_geoip2_module | GeoIP2 country/city lookup using MaxMind databases |
| ngx_http_ssl_module | HTTPS/TLS support |
| ngx_http_v2_module | HTTP/2 support |
| ngx_http_v3_module | HTTP/3 (QUIC) support |
| ngx_http_realip_module | Client real IP extraction |
| ngx_http_image_filter_module | Image transformation |
| ngx_http_xslt_module | XSLT transformations |
| ngx_stream_module | TCP/UDP proxying |
| Library | Description |
|---|---|
| lua-resty-expr | Expression evaluator for complex rule matching |
| lua-resty-http | HTTP client library for OpenResty |
| lua-resty-ipmatcher | High-performance IP/CIDR matching |
| lua-resty-radixtree | Radix tree implementation for efficient routing |
| Path | Description |
|---|---|
/etc/nginx | Configuration directory |
/etc/nginx/nginx.conf | Main configuration file |
/opt/openresty | OpenResty installation directory |
/opt/openresty/lualib | Lua library path |
/opt/openresty/nginx | Nginx server root |
/var/log/nginx | Log files |
/var/lib/nginx | Runtime data (temp files, client bodies) |
/docker-entrypoint.d | Entrypoint initialization scripts |
| Variable | Description |
|---|---|
NGINX_ENTRYPOINT_QUIET_LOGS | Set to suppress entrypoint log output |
LUA_PATH | Lua module search path |
LUA_CPATH | Lua C module search path |
PATH | Includes OpenResty binaries |
The container supports initialization scripts placed in /docker-entrypoint.d/:
*.sh files are executed on container startup*.envsh files are sourced into the environmentchmod +x)Example initialization script:
#!/bin/sh
# /docker-entrypoint.d/10-init-lua.sh
echo "Initializing Lua cache..."
mkdir -p /var/lib/nginx/lua_cache
Images are available on Docker Hub:
sungyism/openresty:latest - Latest stable buildsungyism/openresty:1.29.2.2 - Version-specific tagopenresty (UID 101) by defaultThe image is built with optimizations:
-O3 compiler optimization level-fPIC)Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
This project is maintained using Claude Code (claude.ai/code), Anthropic's AI-powered coding assistant. All code modifications, documentation updates, and maintenance tasks are orchestrated through AI-assisted development workflows.
This approach enables:
For transparency, all commit messages include Co-Authored-By attribution indicating AI assistance.
Maintained by iYism [email protected]
Content type
Image
Digest
sha256:a844be418…
Size
88.4 MB
Last updated
3 months ago
docker pull sungyism/openresty