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

24 views
Skip to first unread message

Nazneen Malik

unread,
May 24, 2018, 8:37:49 PM5/24/18
to openresty-en
I am trying to build an openresty alpine image with lua-openssl like so

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

# Connect to project network to get this to work
RUN apk add --update \
    openssl openssl-dev \
    lua5.3 luajit-dev  lua-socket   \
    git;    \
    rm -rf /var/cache/apk/*

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

But I get the one below and a lot of such errors:

ar rcs libopenssl.a src/asn1.o src/auxiliar.o src/bio.o src/cipher.o src/cms.o src/compat.o src/crl.o src/csr.o src/dh.o src/digest.o src/dsa.o src/ec.o src/engine.o src/hmac.o src/lbn.o src/lhash.o src/misc.o src/ocsp.o src/openssl.o src/ots.o src/pkcs12.o src/pkcs7.o src/pkey.o src/rsa.o src/ssl.o src/th-lock.o src/util.o src/x509.o src/xattrs.o src/xexts.o src/xname.o src/xstore.o src/xalgor.o src/callback.o src/sm2.o src/srp.o

cc -o openssl.so src/openssl.o -L. -lopenssl -Wl,--no-undefined -fpic -lrt -ldl -lm -shared -lssl -Wl,--as-needed -ldl -lz -Wl,--as-needed -ldl -lz -lcrypto -Wl,--as-needed -ldl -lz -lluajit-5.1

src/openssl.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(asn1.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(bio.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(cipher.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(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 to `strerror_s' follow

collect2: error: ld returned 1 exit status

make: *** [Makefile:94: openssl.so] Error 1

The command '/bin/sh -c git clone https://github.com/zhaozg/lua-openssl.git /usr/local/lua-openssl; cd /usr/local/lua-openssl; git checkout e923252b28cff43add6382853cc85ed888c4474b; make' returned a non-zero code: 2

 


Am I missing a package?

Reply all
Reply to author
Forward
0 new messages