Add support for arm, arm64 and s390x arch
This commit is contained in:
parent
172f7548d4
commit
9f426888b8
3 changed files with 50 additions and 20 deletions
|
@ -27,9 +27,19 @@ MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
|
|||
# Set default base image dynamically for each arch
|
||||
BASEIMAGE?=gcr.io/google_containers/ubuntu-slim-$(ARCH):0.9
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
QEMUARCH=arm
|
||||
endif
|
||||
#ifeq ($(ARCH),arm64)
|
||||
# QEMUARCH=aarch64
|
||||
#endif
|
||||
ifeq ($(ARCH),ppc64le)
|
||||
QEMUARCH=ppc64le
|
||||
endif
|
||||
#ifeq ($(ARCH),s390x)
|
||||
# QEMUARCH=s390x
|
||||
#endif
|
||||
|
||||
|
||||
TEMP_DIR := $(shell mktemp -d)
|
||||
|
||||
|
|
|
@ -128,24 +128,7 @@ cd "$BUILD_PATH/nginx-$NGINX_VERSION"
|
|||
echo "Applying tls nginx patches..."
|
||||
patch -p1 < $BUILD_PATH/nginx__dynamic_tls_records.patch
|
||||
|
||||
CC_OPT='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64'
|
||||
if [[ ${ARCH} == "x86_64" ]]; then
|
||||
CC_OPT+=' -mtune=generic'
|
||||
fi
|
||||
|
||||
./configure \
|
||||
--prefix=/usr/share/nginx \
|
||||
--conf-path=/etc/nginx/nginx.conf \
|
||||
--http-log-path=/var/log/nginx/access.log \
|
||||
--error-log-path=/var/log/nginx/error.log \
|
||||
--lock-path=/var/lock/nginx.lock \
|
||||
--pid-path=/run/nginx.pid \
|
||||
--http-client-body-temp-path=/var/lib/nginx/body \
|
||||
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
|
||||
--http-proxy-temp-path=/var/lib/nginx/proxy \
|
||||
--http-scgi-temp-path=/var/lib/nginx/scgi \
|
||||
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
|
||||
--with-debug \
|
||||
WITH_FLAGS="--with-debug \
|
||||
--with-pcre-jit \
|
||||
--with-http_ssl_module \
|
||||
--with-http_stub_status_module \
|
||||
|
@ -160,8 +143,31 @@ fi
|
|||
--with-stream \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_ssl_preread_module \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
--with-threads"
|
||||
|
||||
if [[ ${ARCH} != "armv7l" || ${ARCH} != "aarch64" ]]; then
|
||||
WITH_FLAGS+=" --with-file-aio"
|
||||
fi
|
||||
|
||||
CC_OPT='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4'
|
||||
|
||||
if [[ ${ARCH} == "x86_64" ]]; then
|
||||
CC_OPT+=' -m64 -mtune=generic'
|
||||
fi
|
||||
|
||||
./configure \
|
||||
--prefix=/usr/share/nginx \
|
||||
--conf-path=/etc/nginx/nginx.conf \
|
||||
--http-log-path=/var/log/nginx/access.log \
|
||||
--error-log-path=/var/log/nginx/error.log \
|
||||
--lock-path=/var/lock/nginx.lock \
|
||||
--pid-path=/run/nginx.pid \
|
||||
--http-client-body-temp-path=/var/lib/nginx/body \
|
||||
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
|
||||
--http-proxy-temp-path=/var/lib/nginx/proxy \
|
||||
--http-scgi-temp-path=/var/lib/nginx/scgi \
|
||||
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
|
||||
${WITH_FLAGS} \
|
||||
--without-mail_pop3_module \
|
||||
--without-mail_smtp_module \
|
||||
--without-mail_imap_module \
|
||||
|
|
|
@ -31,11 +31,25 @@ PUSH_TOOL ?= gcloud
|
|||
ifeq ($(ARCH),amd64)
|
||||
BASEIMAGE?=ubuntu:16.04
|
||||
endif
|
||||
ifeq ($(ARCH),arm)
|
||||
BASEIMAGE?=armhf/ubuntu:16.04
|
||||
QEMUARCH=arm
|
||||
endif
|
||||
ifeq ($(ARCH),arm64)
|
||||
BASEIMAGE?=aarch64/ubuntu:16.04
|
||||
QEMUARCH=aarch64
|
||||
endif
|
||||
ifeq ($(ARCH),ppc64le)
|
||||
BASEIMAGE?=ppc64le/ubuntu:16.04
|
||||
QEMUARCH=ppc64le
|
||||
endif
|
||||
|
||||
#ifeq ($(ARCH),s390x)
|
||||
# BASEIMAGE?=s390x/ubuntu:16.04
|
||||
# QEMUARCH=s390x
|
||||
#endif
|
||||
|
||||
|
||||
TEMP_DIR := $(shell mktemp -d)
|
||||
|
||||
container: clean
|
||||
|
|
Loading…
Reference in a new issue