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

Switch to nginx again #4863

Merged
merged 3 commits into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Switch to nginx
  • Loading branch information
aledbf committed Dec 29, 2019
commit 283536154d716bb1e93fb6bd027bfc7d1bb339be
4 changes: 2 additions & 2 deletions images/nginx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# 0.0.0 shouldn't clobber any released builds
TAG ?= 0.94
TAG ?= 0.95
REGISTRY ?= quay.io/kubernetes-ingress-controller
ARCH ?= $(shell go env GOARCH)
DOCKER ?= docker
Expand All @@ -26,7 +26,7 @@ ifeq ($(GOHOSTOS),darwin)
SED_I=sed -i ''
endif

QEMUVERSION=v4.1.0-1
QEMUVERSION=v4.1.1-1

IMGNAME = nginx
IMAGE = $(REGISTRY)/$(IMGNAME)
Expand Down
63 changes: 54 additions & 9 deletions images/nginx/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,68 @@
# limitations under the License.


FROM BASEIMAGE
FROM BASEIMAGE as builder

CROSS_BUILD_COPY qemu-ARCH-static /usr/bin/

ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin

# Add LuaRocks paths
# see https://github.com/openresty/docker-openresty/blob/de05cd72594498b83e3a97e2f632da6aa75ec01d/bionic/Dockerfile#L168
ENV LUA_PATH="/usr/local/openresty/site/lualib/?.ljbc;/usr/local/openresty/site/lualib/?/init.ljbc;/usr/local/openresty/lualib/?.ljbc;/usr/local/openresty/lualib/?/init.ljbc;/usr/local/openresty/site/lualib/?.lua;/usr/local/openresty/site/lualib/?/init.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua;/usr/local/lib/lua/?.lua"
ENV LUA_CPATH="/usr/local/openresty/site/lualib/?.so;/usr/local/openresty/lualib/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so"
RUN clean-install bash

COPY . /

RUN clean-install bash

RUN /build.sh

# Use a multi-stage build
FROM BASEIMAGE

ENV PATH=$PATH:/usr/local/luajit/bin:/usr/local/nginx/sbin:/usr/local/nginx/bin

ENV LUA_PATH="/usr/local/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/lib/lua/?.lua;;"
ENV LUA_CPATH="/usr/local/lib/lua/?/?.so;/usr/local/lib/lua/?.so;;"

COPY --from=builder /usr/local /usr/local
COPY --from=builder /opt /opt
COPY --chown=www-data:www-data --from=builder /etc/nginx /etc/nginx

RUN apt-get update && apt-get dist-upgrade -y \
&& clean-install \
bash \
curl ca-certificates \
libgeoip1 \
patch \
libpcre3 \
zlib1g \
libaio1 \
openssl \
util-linux \
lmdb-utils \
libcurl4 \
libprotobuf17 \
libz3-4 \
procps \
libxml2 libpcre++0v5 \
liblmdb0 \
libmaxminddb0 \
dumb-init \
nano \
libyaml-cpp0.6 \
libyajl2 \
&& ln -s /usr/local/nginx/sbin/nginx /sbin/nginx \
&& ln -s /usr/local/lib/mimalloc-1.2/libmimalloc.so /usr/local/lib/libmimalloc.so \
&& bash -eu -c ' \
writeDirs=( \
/var/log/nginx \
/var/lib/nginx/body \
/var/lib/nginx/fastcgi \
/var/lib/nginx/proxy \
/var/lib/nginx/scgi \
/var/lib/nginx/uwsgi \
/var/log/audit \
); \
for dir in "${writeDirs[@]}"; do \
mkdir -p ${dir}; \
chown -R www-data.www-data ${dir}; \
done'

EXPOSE 80 443

CMD ["nginx", "-g", "daemon off;"]
Loading