-
Notifications
You must be signed in to change notification settings - Fork 99
feat: update apisix-base to cross-compile on minideb #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bzp2010
wants to merge
8
commits into
api7:master
Choose a base branch
from
bzp2010:feat-apisix-base-cross
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
29bbe91
feat: update to cross-compile on minideb
bzp2010 3b76045
feat: clean libwasmtime.a
bzp2010 b1fcfba
fix: apk build failed
bzp2010 12a199c
feat: add back alpine image build
bzp2010 e963805
fix: update env access
bzp2010 b5bbc37
fix
bzp2010 8b9dadd
fix: add default env
bzp2010 0210a21
chore: add EOL
bzp2010 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
FROM --platform=amd64 bitnami/minideb:bullseye as build | ||
|
||
COPY ./utils/build-common.sh \ | ||
./utils/install-common.sh \ | ||
build-apisix-base.sh \ | ||
./utils/determine-dist.sh \ | ||
/tmp/ | ||
|
||
ARG RESTY_OPENSSL_VERSION="1.1.1g" | ||
ARG RESTY_OPENSSL_PATCH_VERSION="1.1.1f" | ||
ARG RESTY_OPENSSL_URL_BASE="https://www.openssl.org/source" | ||
ARG RESTY_PCRE_VERSION="8.44" | ||
ARG RESTY_J="1" | ||
ARG RESTY_EVAL_PRE_CONFIGURE="" | ||
ARG VERSION | ||
ARG TARGETARCH | ||
|
||
LABEL resty_image_base="${RESTY_IMAGE_BASE}" | ||
LABEL resty_image_tag="${IMAGE_TAG}" | ||
LABEL resty_openssl_version="${RESTY_OPENSSL_VERSION}" | ||
LABEL resty_openssl_patch_version="${RESTY_OPENSSL_PATCH_VERSION}" | ||
LABEL resty_openssl_url_base="${RESTY_OPENSSL_URL_BASE}" | ||
LABEL resty_pcre_version="${RESTY_PCRE_VERSION}" | ||
LABEL resty_eval_pre_configure="${RESTY_EVAL_PRE_CONFIGURE}" | ||
|
||
RUN dpkg --add-architecture ${TARGETARCH} \ | ||
&& install_packages ca-certificates \ | ||
curl \ | ||
wget \ | ||
git \ | ||
gettext-base \ | ||
patch \ | ||
xz-utils \ | ||
sudo \ | ||
make \ | ||
perl \ | ||
unzip \ | ||
libgd-dev:${TARGETARCH} \ | ||
libgeoip-dev:${TARGETARCH} \ | ||
libncurses5-dev:${TARGETARCH} \ | ||
libperl-dev:${TARGETARCH} \ | ||
libreadline-dev:${TARGETARCH} \ | ||
libxslt1-dev:${TARGETARCH} \ | ||
zlib1g-dev:${TARGETARCH} \ | ||
&& if [ "${TARGETARCH}" = "amd64" ] ; then install_packages gcc g++; fi \ | ||
&& if [ "${TARGETARCH}" = "arm64" ] ; then \ | ||
install_packages gcc-aarch64-linux-gnu g++-aarch64-linux-gnu; \ | ||
ln /usr/bin/aarch64-linux-gnu-gcc /usr/bin/cc; \ | ||
ln /usr/bin/aarch64-linux-gnu-gcc /usr/bin/gcc; \ | ||
ln /usr/bin/aarch64-linux-gnu-ar /usr/bin/ar; \ | ||
ln /usr/bin/aarch64-linux-gnu-ranlib /usr/bin/ranlib; \ | ||
ln /usr/bin/aarch64-linux-gnu-g++ /usr/bin/g++; \ | ||
fi \ | ||
&& gcc -v \ | ||
&& g++ -v | ||
|
||
RUN echo ${TARGETARCH} \ | ||
&& cd /tmp \ | ||
&& if [ -n "${RESTY_EVAL_PRE_CONFIGURE}" ]; then eval $(echo ${RESTY_EVAL_PRE_CONFIGURE}); fi \ | ||
&& cd /tmp \ | ||
&& curl -fSL "${RESTY_OPENSSL_URL_BASE}/openssl-${RESTY_OPENSSL_VERSION}.tar.gz" -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ | ||
&& tar xzf openssl-${RESTY_OPENSSL_VERSION}.tar.gz \ | ||
&& cd openssl-${RESTY_OPENSSL_VERSION} \ | ||
&& echo 'patching OpenSSL 1.1.1 for OpenResty' \ | ||
&& curl -s https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-${RESTY_OPENSSL_PATCH_VERSION}-sess_set_get_cb_yield.patch | patch -p1 \ | ||
&& if [ "${TARGETARCH}" = "arm64" ] ; then export MACHINE=aarch64; fi \ | ||
&& ./config \ | ||
no-threads shared zlib -g \ | ||
enable-ssl3 enable-ssl3-method \ | ||
--prefix=/usr/local/openresty/openssl111 \ | ||
--libdir=lib \ | ||
-Wl,-rpath,/usr/local/openresty/openssl111/lib \ | ||
&& make -j${RESTY_J} \ | ||
&& make -j${RESTY_J} install_sw | ||
|
||
RUN echo ${TARGETARCH} \ | ||
&& cd /tmp \ | ||
&& curl -fSL https://downloads.sourceforge.net/project/pcre/pcre/${RESTY_PCRE_VERSION}/pcre-${RESTY_PCRE_VERSION}.tar.gz -o pcre-${RESTY_PCRE_VERSION}.tar.gz \ | ||
&& tar xzf pcre-${RESTY_PCRE_VERSION}.tar.gz \ | ||
&& cd /tmp/pcre-${RESTY_PCRE_VERSION} \ | ||
&& ./configure \ | ||
--prefix=/usr/local/openresty/pcre \ | ||
--disable-cpp \ | ||
--enable-jit \ | ||
--enable-utf \ | ||
--enable-unicode-properties \ | ||
&& make -j${RESTY_J} \ | ||
&& make -j${RESTY_J} install | ||
|
||
ENV version=${VERSION} | ||
ENV TARGETARCH=${TARGETARCH} | ||
|
||
RUN echo ${TARGETARCH} \ | ||
&& cd /tmp \ | ||
&& curl --version \ | ||
&& ./build-common.sh build_apisix_base_minideb \ | ||
&& ./install-common.sh install_lua \ | ||
&& ./install-common.sh install_luarocks \ | ||
&& rm -f /usr/local/openresty/wasmtime-c-api/lib/libwasmtime.a \ | ||
&& /usr/local/openresty/bin/openresty -V | ||
|
||
FROM bitnami/minideb:bullseye as prod | ||
|
||
COPY --from=build /usr/local/openresty /usr/local/openresty | ||
|
||
RUN install_packages libgd3 \ | ||
libgeoip1 \ | ||
libxslt1.1 \ | ||
zlib1g | ||
|
||
ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin | ||
|
||
CMD /bin/sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasm support build for arm64: https://github.com/api7/wasm-nginx-module/blob/main/install-wasmtime.sh#L17