forked from kubernetes/ingress-nginx
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: galal-hussein <[email protected]>
- Loading branch information
1 parent
1e756b9
commit ff85cb1
Showing
13 changed files
with
340 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# 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. | ||
|
||
|
||
# Use a multi-stage build | ||
FROM rockylinux:8 as builder | ||
|
||
RUN yum -y update \ | ||
&& yum -y upgrade \ | ||
&& yum -y install epel-release 'dnf-command(config-manager)' \ | ||
&& yum -y upgrade \ | ||
&& yum config-manager --set-enabled powertools \ | ||
&& yum -y install dnf | ||
RUN dnf -y install conntrack-tools findutils which | ||
|
||
COPY patches /patches | ||
COPY build.sh / | ||
|
||
RUN /build.sh | ||
|
||
# Pull static components from alpine | ||
FROM alpine:3.13 as extras | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add -U --no-cache dumb-init | ||
|
||
# With UBI as base image | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal | ||
|
||
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 --from=builder /etc/nginx /etc/nginx | ||
COPY --from=extras /usr/bin/dumb-init /usr/bin/dumb-init | ||
|
||
RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm | ||
RUN microdnf -y update && rm -rf /var/cache/yum | ||
RUN microdnf -y install lmdb-libs || rpm -iv http://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/lmdb-libs-0.9.24-1.el8.x86_64.rpm | ||
RUN microdnf -y install \ | ||
util-linux \ | ||
findutils \ | ||
which \ | ||
yajl \ | ||
GeoIP \ | ||
libmaxminddb \ | ||
wget | ||
|
||
RUN microdnf -y install crypto-policies-scripts | ||
|
||
RUN rm -rf /var/cache/yum | ||
|
||
RUN ldDirs=" \ | ||
/usr/local/lib \ | ||
/usr/local/lib64 \ | ||
"; \ | ||
for dir in ${ldDirs}; do \ | ||
echo "${dir}" >>/etc/ld.so.conf.d/local.conf; \ | ||
done | ||
RUN /sbin/ldconfig | ||
|
||
RUN ln -s /usr/local/nginx/sbin/nginx /sbin/nginx | ||
RUN groupadd -rg 101 www-data | ||
RUN adduser -u 101 -M -d /usr/local/nginx -s /sbin/nologin -G www-data -g www-data www-data | ||
|
||
RUN 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 | ||
|
||
RUN microdnf clean all | ||
|
||
EXPOSE 80 443 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# 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. | ||
|
||
|
||
# Use a multi-stage build | ||
FROM registry.opensuse.org/opensuse/leap-dnf:15.4 as builder | ||
|
||
RUN dnf makecache \ | ||
&& dnf -y upgrade | ||
RUN dnf -y install conntrack-tools findutils which microdnf libcap-progs | ||
|
||
COPY patches /patches | ||
COPY build.sh / | ||
|
||
RUN /build.sh | ||
|
||
# Pull static components from alpine | ||
FROM alpine:3.18 as extras | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add -U --no-cache dumb-init | ||
|
||
# With OpenSUSE Leap DNF as base image | ||
FROM registry.opensuse.org/opensuse/leap-dnf:15.4 | ||
|
||
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 --from=builder /etc/nginx /etc/nginx | ||
COPY --from=extras /usr/bin/dumb-init /usr/bin/dumb-init | ||
|
||
RUN dnf -y install \ | ||
util-linux \ | ||
findutils \ | ||
which \ | ||
yajl \ | ||
GeoIP \ | ||
libmaxminddb0 \ | ||
lmdb \ | ||
wget \ | ||
libcap-progs | ||
|
||
RUN dnf -y install 'dnf-command(config-manager)' | ||
RUN dnf config-manager --add-repo https://download.opensuse.org/repositories/security:tls/15.4/security:tls.repo | ||
RUN dnf -y install crypto-policies-scripts | ||
|
||
RUN rm -rf /var/cache/yum | ||
|
||
RUN ldDirs=" \ | ||
/usr/local/lib \ | ||
/usr/local/lib64 \ | ||
"; \ | ||
for dir in ${ldDirs}; do \ | ||
echo "${dir}" >>/etc/ld.so.conf.d/local.conf; \ | ||
done | ||
RUN /sbin/ldconfig | ||
|
||
RUN ln -s /usr/local/nginx/sbin/nginx /sbin/nginx | ||
RUN groupadd -rg 101 www-data | ||
RUN useradd -u 101 -M -d /usr/local/nginx -s /sbin/nologin -G www-data -g www-data www-data | ||
|
||
RUN 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 | ||
|
||
RUN dnf clean all | ||
|
||
EXPOSE 80 443 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
Oops, something went wrong.