2017-01-31 18:19:58 +00:00
|
|
|
# Copyright 2015 The Kubernetes Authors. All rights reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2024-09-07 18:51:20 +00:00
|
|
|
FROM alpine:3.20 as builder
|
2017-04-11 13:49:15 +00:00
|
|
|
|
2018-08-04 12:02:20 +00:00
|
|
|
COPY . /
|
2017-01-31 18:19:58 +00:00
|
|
|
|
2021-01-15 02:50:51 +00:00
|
|
|
RUN apk update \
|
|
|
|
&& apk upgrade \
|
2023-04-06 17:25:48 +00:00
|
|
|
&& apk add -U bash --no-cache \
|
2019-12-27 22:45:05 +00:00
|
|
|
&& /build.sh
|
2017-01-31 18:19:58 +00:00
|
|
|
|
2019-12-24 17:42:59 +00:00
|
|
|
# Use a multi-stage build
|
2024-09-07 18:51:20 +00:00
|
|
|
FROM alpine:3.20
|
2019-12-24 17:42:59 +00:00
|
|
|
|
|
|
|
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
|
2019-12-27 22:45:05 +00:00
|
|
|
COPY --from=builder /etc/nginx /etc/nginx
|
2019-12-24 17:42:59 +00:00
|
|
|
|
2023-12-26 01:38:42 +00:00
|
|
|
LABEL org.opencontainers.image.source=https://github.com/kubernetes/ingress-nginx
|
|
|
|
|
2022-06-23 15:29:42 +00:00
|
|
|
RUN apk update \
|
2020-04-27 18:23:12 +00:00
|
|
|
&& apk upgrade \
|
|
|
|
&& apk add -U --no-cache \
|
2022-03-31 11:25:00 +00:00
|
|
|
bash \
|
|
|
|
openssl \
|
|
|
|
pcre \
|
|
|
|
zlib \
|
|
|
|
ca-certificates \
|
|
|
|
patch \
|
|
|
|
yajl \
|
|
|
|
lmdb \
|
|
|
|
libxml2 \
|
|
|
|
libmaxminddb \
|
|
|
|
yaml-cpp \
|
|
|
|
dumb-init \
|
|
|
|
tzdata \
|
2019-12-24 17:42:59 +00:00
|
|
|
&& ln -s /usr/local/nginx/sbin/nginx /sbin/nginx \
|
2019-12-27 22:45:05 +00:00
|
|
|
&& adduser -S -D -H -u 101 -h /usr/local/nginx \
|
2022-03-31 11:25:00 +00:00
|
|
|
-s /sbin/nologin -G www-data -g www-data www-data \
|
2019-12-24 17:42:59 +00:00
|
|
|
&& bash -eu -c ' \
|
|
|
|
writeDirs=( \
|
2022-03-31 11:25:00 +00:00
|
|
|
/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 \
|
2019-12-24 17:42:59 +00:00
|
|
|
); \
|
|
|
|
for dir in "${writeDirs[@]}"; do \
|
2022-03-31 11:25:00 +00:00
|
|
|
mkdir -p ${dir}; \
|
|
|
|
chown -R www-data.www-data ${dir}; \
|
2023-10-07 02:04:58 +00:00
|
|
|
done'
|
2019-12-24 17:42:59 +00:00
|
|
|
|
2017-01-31 18:19:58 +00:00
|
|
|
EXPOSE 80 443
|
|
|
|
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|