在 alpine 图像上构建 lua-openssl 时未定义对“strerror_s”的引用

undefined references to `strerror_s' while building lua-openssl on alpine image

我正在尝试像这样使用 lua-openssl 构建一个 openresty alpine 镜像

FROM openresty/openresty:alpine-fat

# Set the version
ENV RESTY_CONFIG_OPTIONS_MORE "--with-ngx_http_ssl_module"
EXPOSE 80
EXPOSE 443

RUN ls /usr/local/openresty/nginx/logs

COPY lualib /usr/local/openresty/nginx/lualib
RUN chown -R nobody:root /usr/local/openresty/nginx/lualib

RUN apk add --update \
    openssl openssl-dev \
    lua5.3 luajit-dev  lua-socket   \
    git

RUN git clone https://github.com/zhaozg/lua-openssl.git /usr/local/lua-openssl;     \
    cd /usr/local/lua-openssl;  \
    git checkout e923252b28cff43add6382853cc85ed888c4474b;   \
    make

但是我得到了下面的错误和很多这样的错误:

/usr/local/lua-openssl/deps/lua-compat/c-api/compat-5.3.c:74: undefined reference to strerror_s' ./libopenssl.a(cms.o): In function compat53_strerror': /usr/local/lua-openssl/deps/lua-compat/c-api/compat-5.3.c:74: undefined reference to strerror_s' ./libopenssl.a(compat.o):/usr/local/lua-openssl/deps/lua-compat/c-api/compat-5.3.c:74: more undefined references tostrerror_s' follow collect2: error: ld returned 1 exit status make: *** [Makefile:94: openssl.so] Error 1

我是不是丢了包裹?

(1) 我们抓取了可信赖的图像而不是高山脂肪。 (2) 用一个使用 lcrypto lib 构建的文件覆盖 make 文件。

这是我所知道的唯一能使这项工作成功的设置。

我没有尝试用 MSVC++ 编译。

我的问题及其修复在 https://github.com/zhaozg/lua-openssl/issues/138

中进行了跟踪