Release nginx-slim 0.22

This commit is contained in:
Manuel de Brito Fontes 2017-08-03 22:43:34 -04:00
parent 15a888b6ba
commit 95b04ff9eb
4 changed files with 14 additions and 67 deletions

View file

@ -13,32 +13,32 @@
# limitations under the License.
# 0.0.0 shouldn't clobber any released builds
TAG = 0.21
TAG = 0.22
REGISTRY = gcr.io/google_containers
ARCH ?= $(shell go env GOARCH)
ALL_ARCH = amd64 arm ppc64le
ALL_ARCH = amd64 arm arm64 ppc64le
QEMUVERSION=v2.7.0
QEMUVERSION=v2.9.1
IMGNAME = nginx-slim
IMAGE = $(REGISTRY)/$(IMGNAME)
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
# Set default base image dynamically for each arch
BASEIMAGE?=gcr.io/google_containers/ubuntu-slim-$(ARCH):0.13
BASEIMAGE?=gcr.io/google_containers/ubuntu-slim-$(ARCH):0.14
ifeq ($(ARCH),arm)
QEMUARCH=arm
endif
#ifeq ($(ARCH),arm64)
# QEMUARCH=aarch64
#endif
ifeq ($(ARCH),arm64)
QEMUARCH=aarch64
endif
ifeq ($(ARCH),ppc64le)
QEMUARCH=ppc64le
endif
#ifeq ($(ARCH),s390x)
# QEMUARCH=s390x
#endif
ifeq ($(ARCH),s390x)
QEMUARCH=s390x
endif
TEMP_DIR := $(shell mktemp -d)

View file

@ -1,10 +1,9 @@
nginx 1.13.x base image using [ubuntu-slim](https://github.com/kubernetes/contrib/tree/master/images/ubuntu-slim)
nginx 1.13.x base image using [ubuntu-slim](https://github.com/kubernetes/ingress/tree/master/images/ubuntu-slim)
nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP proxy server.
This custom nginx image contains:
- [lua](https://github.com/openresty/lua-nginx-module) support
- [stream](http://nginx.org/en/docs/stream/ngx_stream_core_module.html) tcp support for upstreams
- nginx stats [nginx-module-vts](https://github.com/vozlt/nginx-module-vts)
- [Dynamic TLS record sizing](https://blog.cloudflare.com/optimizing-tls-over-tcp-to-reduce-latency/)
@ -15,7 +14,7 @@ This image does provides a default configuration file with no backend servers.
*Using docker*
```
$ docker run -v /some/nginx.con:/etc/nginx/nginx.conf:ro gcr.io/google_containers/nginx-slim:0.20
$ docker run -v /some/nginx.con:/etc/nginx/nginx.conf:ro gcr.io/google_containers/nginx-slim:0.22
```
*Creating a replication controller*

View file

@ -21,11 +21,7 @@ export NGINX_VERSION=1.13.3
export NDK_VERSION=0.3.0
export VTS_VERSION=0.1.15
export SETMISC_VERSION=0.31
export LUA_VERSION=0.10.8
export STICKY_SESSIONS_VERSION=08a395c66e42
export LUA_CJSON_VERSION=2.1.0.4
export LUA_RESTY_HTTP_VERSION=0.07
export LUA_UPSTREAM_VERSION=0.06
export MORE_HEADERS_VERSION=0.32
export NGINX_DIGEST_AUTH=7955af9c77598c697ac292811914ce1e2b3b824c
export NGINX_SUBSTITUTIONS=bc58cb11844bc42735bbaef7085ea86ace46d05b
@ -50,9 +46,7 @@ mkdir "$BUILD_PATH"
cd "$BUILD_PATH"
if [[ ${ARCH} == "ppc64le" ]]; then
apt-get update && apt-get install --no-install-recommends -y software-properties-common && \
add-apt-repository -y ppa:ibmpackages/luajit
apt-get update && apt-get install --no-install-recommends -y lua5.1 lua5.1-dev
apt-get update && apt-get install --no-install-recommends -y software-properties-common
fi
# install required packages to build
@ -70,10 +64,7 @@ apt-get update && apt-get install --no-install-recommends -y \
zlib1g-dev \
libaio1 \
libaio-dev \
luajit \
openssl \
libluajit-5.1 \
libluajit-5.1-dev \
linux-headers-generic || exit 1
# download, verify and extract the source files
@ -89,21 +80,9 @@ get_src 97946a68937b50ab8637e1a90a13198fe376d801dc3e7447052e43c28e9ee7de \
get_src 5112a054b1b1edb4c0042a9a840ef45f22abb3c05c68174e28ebf483164fb7e1 \
"https://github.com/vozlt/nginx-module-vts/archive/v$VTS_VERSION.tar.gz"
get_src d67449c71051b3cc2d6dd60df0ae0d21fca08aa19c9b30c5b95ee21ff38ef8dd \
"https://github.com/openresty/lua-nginx-module/archive/v$LUA_VERSION.tar.gz"
get_src 5417991b6db4d46383da2d18f2fd46b93fafcebfe87ba87f7cfeac4c9bcb0224 \
"https://github.com/openresty/lua-cjson/archive/$LUA_CJSON_VERSION.tar.gz"
get_src 1c6aa06c9955397c94e9c3e0c0fba4e2704e85bee77b4512fb54ae7c25d58d86 \
"https://github.com/pintsized/lua-resty-http/archive/v$LUA_RESTY_HTTP_VERSION.tar.gz"
get_src c6d9dab8ea1fc997031007e2e8f47cced01417e203cd88d53a9fe9f6ae138720 \
"https://github.com/openresty/headers-more-nginx-module/archive/v$MORE_HEADERS_VERSION.tar.gz"
get_src 55475fe4f9e4b5220761269ccf0069ebb1ded61d7e7888f9c785c651cff3d141 \
"https://github.com/openresty/lua-upstream-nginx-module/archive/v$LUA_UPSTREAM_VERSION.tar.gz"
get_src 53e440737ed1aff1f09fae150219a45f16add0c8d6e84546cb7d80f73ebffd90 \
"https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/$STICKY_SESSIONS_VERSION.tar.gz"
@ -117,11 +96,6 @@ get_src 8eabbcd5950fdcc718bb0ef9165206c2ed60f67cd9da553d7bc3e6fe4e338461 \
#https://blog.cloudflare.com/optimizing-tls-over-tcp-to-reduce-latency/
curl -sSL -o nginx__dynamic_tls_records.patch https://raw.githubusercontent.com/cloudflare/sslconfig/master/patches/nginx__1.11.5_dynamic_tls_records.patch
# https://github.com/openresty/lua-nginx-module/issues/1016
curl -sSL -o patch-src-ngx_http_lua_headers.c.diff https://raw.githubusercontent.com/macports/macports-ports/master/www/nginx/files/patch-src-ngx_http_lua_headers.c.diff
cd "$BUILD_PATH/lua-nginx-module-$LUA_VERSION"
patch -p1 < $BUILD_PATH/patch-src-ngx_http_lua_headers.c.diff
# build nginx
cd "$BUILD_PATH/nginx-$NGINX_VERSION"
@ -177,32 +151,13 @@ fi
--add-module="$BUILD_PATH/ngx_devel_kit-$NDK_VERSION" \
--add-module="$BUILD_PATH/set-misc-nginx-module-$SETMISC_VERSION" \
--add-module="$BUILD_PATH/nginx-module-vts-$VTS_VERSION" \
--add-module="$BUILD_PATH/lua-nginx-module-$LUA_VERSION" \
--add-module="$BUILD_PATH/headers-more-nginx-module-$MORE_HEADERS_VERSION" \
--add-module="$BUILD_PATH/nginx-goodies-nginx-sticky-module-ng-$STICKY_SESSIONS_VERSION" \
--add-module="$BUILD_PATH/nginx-http-auth-digest-$NGINX_DIGEST_AUTH" \
--add-module="$BUILD_PATH/ngx_http_substitutions_filter_module-$NGINX_SUBSTITUTIONS" \
--add-module="$BUILD_PATH/lua-upstream-nginx-module-$LUA_UPSTREAM_VERSION" || exit 1 \
&& make || exit 1 \
&& make install || exit 1
echo "Installing CJSON module"
cd "$BUILD_PATH/lua-cjson-$LUA_CJSON_VERSION"
if [[ ${ARCH} == "ppc64le" ]];then
LUA_DIR=/usr/include/luajit-2.1
else
LUA_DIR=/usr/include/luajit-2.0
fi
make LUA_INCLUDE_DIR=${LUA_DIR} && make install
echo "Installing lua-resty-http module"
# copy lua module
cd "$BUILD_PATH/lua-resty-http-$LUA_RESTY_HTTP_VERSION"
sed -i 's/resty.http_headers/http_headers/' $BUILD_PATH/lua-resty-http-$LUA_RESTY_HTTP_VERSION/lib/resty/http.lua
cp $BUILD_PATH/lua-resty-http-$LUA_RESTY_HTTP_VERSION/lib/resty/http.lua /usr/local/lib/lua/5.1
cp $BUILD_PATH/lua-resty-http-$LUA_RESTY_HTTP_VERSION/lib/resty/http_headers.lua /usr/local/lib/lua/5.1
echo "Cleaning..."
cd /
@ -214,16 +169,10 @@ apt-mark unmarkauto \
libpcre3 \
zlib1g \
libaio1 \
luajit \
libluajit-5.1-2 \
xz-utils \
geoip-bin \
openssl
if [[ ${ARCH} == "ppc64le" ]]; then
apt-mark unmarkauto liblua5.1-0
fi
apt-get remove -y --purge \
build-essential \
gcc-5 \
@ -233,7 +182,6 @@ apt-get remove -y --purge \
libssl-dev \
zlib1g-dev \
libaio-dev \
libluajit-5.1-dev \
linux-libc-dev \
perl-modules-5.22 \
linux-headers-generic

View file

@ -29,6 +29,6 @@ spec:
spec:
containers:
- name: nginxslim
image: gcr.io/google_containers/nginx-slim:0.20
image: gcr.io/google_containers/nginx-slim:0.22
ports:
- containerPort: 80