From 89929f92ebeee2e96b751ddf90b3107c59ea1ac8 Mon Sep 17 00:00:00 2001 From: Shubhendra Kushwaha Date: Mon, 5 Aug 2024 22:47:08 +0530 Subject: [PATCH] fix: build libyaml before installing lyaml --- all-in-one/apisix-dashboard/Dockerfile | 12 +++++++++++- debian-dev/Dockerfile.local | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/all-in-one/apisix-dashboard/Dockerfile b/all-in-one/apisix-dashboard/Dockerfile index bf906d04..0699ee99 100644 --- a/all-in-one/apisix-dashboard/Dockerfile +++ b/all-in-one/apisix-dashboard/Dockerfile @@ -35,9 +35,18 @@ RUN set -x \ libtool \ pkgconfig \ cmake \ + make \ + clang \ + wget \ git \ openldap-dev \ sudo \ + && wget https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz \ + && tar -zxvf yaml-0.2.5.tar.gz \ + && cd yaml-0.2.5 \ + && ./configure \ + && make \ + && make install \ && mkdir ~/.luarocks \ && luarocks config variables.OPENSSL_LIBDIR /usr/local/openresty/openssl/lib \ && luarocks config variables.OPENSSL_INCDIR /usr/local/openresty/openssl/include \ @@ -46,7 +55,7 @@ RUN set -x \ && cp -v /usr/local/apisix/deps/lib/luarocks/rocks-5.1/apisix/${APISIX_VERSION}-0/bin/apisix /usr/bin/ \ && (if [ "$APISIX_VERSION" = "master" ] || [ "$APISIX_VERSION" \> "2.2" ]; then echo 'use shell ';else bin='#! /usr/local/openresty/luajit/bin/luajit\npackage.path = "/usr/local/apisix/?.lua;" .. package.path'; sed -i "1s@.*@$bin@" /usr/bin/apisix ; fi;) \ && mv /usr/local/apisix/deps/share/lua/5.1/apisix /usr/local/apisix \ - && apk del .builddeps build-base make unzip + && apk del .builddeps build-base make unzip clang wget # Build etcd FROM alpine:3.13 AS etcd-stage @@ -116,6 +125,7 @@ WORKDIR /usr/local/apisix COPY --from=production-stage /usr/local/openresty/ /usr/local/openresty/ COPY --from=production-stage /usr/local/apisix/ /usr/local/apisix/ COPY --from=production-stage /usr/bin/apisix /usr/bin/apisix +COPY --from=production-stage /usr/local/lib/libyaml* /usr/local/lib/ COPY --from=etcd-stage /tmp/etcd/etcd /usr/bin/etcd COPY --from=etcd-stage /tmp/etcd/etcdctl /usr/bin/etcdctl diff --git a/debian-dev/Dockerfile.local b/debian-dev/Dockerfile.local index f3ba829c..08364f93 100644 --- a/debian-dev/Dockerfile.local +++ b/debian-dev/Dockerfile.local @@ -35,6 +35,14 @@ RUN set -x \ make \ git \ sudo \ + clang \ + wget \ + && wget https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz \ + && tar -zxvf yaml-0.2.5.tar.gz \ + && cd yaml-0.2.5 \ + && ./configure \ + && make \ + && make install \ && ls -al \ && make deps \ && mkdir -p ${ENV_INST_LUADIR} \ @@ -49,6 +57,7 @@ ARG INSTALL_BROTLI=./install-brotli.sh COPY --from=build /usr/local/apisix /usr/local/apisix COPY --from=build /usr/local/openresty /usr/local/openresty COPY --from=build /usr/bin/apisix /usr/bin/apisix +COPY --from=build /usr/local/lib/libyaml* /usr/local/lib/ COPY ${INSTALL_BROTLI} /install-brotli.sh RUN chmod +x /install-brotli.sh \