Skip to content
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

Fix issues building nginx image in different platforms #2305

Merged
merged 1 commit into from
Apr 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions images/nginx/install_lua_resty_waf.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2015 The Kubernetes Authors.
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,15 @@ cd "$BUILD_PATH"
git clone --recursive --single-branch -b v0.11.1 https://github.com/p0pr0ck5/lua-resty-waf

cd lua-resty-waf

ARCH=$(uname -m)
if [[ ${ARCH} != "x86_64" ]]; then
# replace CFLAGS
sed -i 's/CFLAGS = -msse2 -msse3 -msse4.1 -O3/CFLAGS = -O3/' lua-aho-corasick/Makefile
# export PCRE lib directory
export PCRE_LIBDIR=$(find /usr/lib -name libpcre*.so* | head -1 | xargs dirname)
fi

make
make install-check

Expand All @@ -46,7 +55,11 @@ git clone -b master --single-branch https://github.com/bungle/lua-resty-random.g
cd "$BUILD_PATH/lua-resty-cookie"
make install

luarocks install lrexlib-pcre 2.7.2-1
if [[ ${ARCH} != "x86_64" ]]; then
luarocks install lrexlib-pcre 2.7.2-1 PCRE_LIBDIR=${PCRE_LIBDIR}
else
luarocks install lrexlib-pcre 2.7.2-1
fi

# and do the rest of what "make instal" does
cd "$BUILD_PATH/lua-resty-waf"
Expand Down