Skip to content

Commit

Permalink
fix: build libyaml before installing lyaml
Browse files Browse the repository at this point in the history
  • Loading branch information
TheShubhendra committed Aug 5, 2024
1 parent 2b1c327 commit 89929f9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 11 additions & 1 deletion all-in-one/apisix-dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions debian-dev/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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 \
Expand Down

0 comments on commit 89929f9

Please sign in to comment.