openresty / openresty/lua-nginx-module

Unable to run nginx docker image with lua-nginx-module

Open
#2,032 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

I have a simple docker file with lua module:

FROM nginx:alpine 
RUN apk add --no-cache nginx-mod-http-lua
COPY config/ /etc/nginx/

and nginx.conf has these three lines:

load_module /usr/lib/nginx/modules/ndk_http_module.so;
load_module /usr/lib/nginx/modules/ngx_http_lua_module.so;
pcre_jit on;

I am getting the version mismatch.

module "/usr/lib/nginx/modules/ndk_http_module.so" version 1020002 instead of 1021006 in /etc/nginx/nginx.conf:1
nginx: [emerg] module "/usr/lib/nginx/modules/ndk_http_module.so" version 1020002 instead of 1021006 in /etc/nginx/nginx.conf:1

I am building a docker as :

docker build --build-arg ENABLED_MODULES="ndk lua" -t nginxapp .

If I try to specify the version:

FROM nginx:1.20.2-alpine 
RUN apk update && apk add --no-cache nginx-mod-http-lua=1.20.2-r0
COPY config/ /etc/nginx/

then I get the following:

/docker-entrypoint.sh: Configuration complete; ready for start up
2022/04/01 06:05:46 [emerg] 1#1: module "/usr/lib/nginx/modules/ndk_http_module.so" is not binary compatible in /etc/nginx/nginx.conf:1
nginx: [emerg] module "/usr/lib/nginx/modules/ndk_http_module.so" is not binary compatible in /etc/nginx/nginx.conf:1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the nginx:alpine and nginx:1.20.2-alpine base images with the nginx-mod-http-lua package versions, then inspect the module loading lines in nginx.conf. Reproduce the docker build and startup errors; done means the image starts without the version-mismatch or binary-compatibility errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, lua, nginx
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.