FROM registry.fedoraproject.org/f29/s2i-base:latest
# nginx 1.12 image.
#
# Volumes:
# * /var/log/nginx/ - Storage for logs
EXPOSE 8080
EXPOSE 8443
ENV NAME=nginx \
NGINX_VERSION=1.12 \
VERSION=0 \
ARCH=x86_64
ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \
DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \
protocols, with a strong focus on high concurrency, performance and low memory usage. The container \
image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \
as a base image for other applications based on nginx $NGINX_VERSION web server. \
Nginx server image can be extended using source-to-image tool."
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$SUMMARY" \
io.k8s.display-name="Nginx $NGINX_VERSION" \
io.openshift.expose-services="8080:http" \
io.openshift.expose-services="8443:https" \
io.openshift.tags="builder,nginx,nginx112" \
com.redhat.component="$NAME" \
name="$FGC/$NAME" \
version="$VERSION" \
architecture="$ARCH" \
usage="s2i build file:///your/app $FGC/nginx your-app"
ENV NGINX_CONFIGURATION_PATH=/opt/app-root/etc/nginx.d
ENV NGINX_DEFAULT_CONF_PATH=/opt/app-root/etc/nginx.default.d
RUN dnf install -y gettext hostname && \
INSTALL_PKGS="nss_wrapper bind-utils nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf clean all
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
# Copy extra files to the image.
COPY ./root/ /
# In order to drop the root user, we have to make some directories world
# writeable as OpenShift default security model is to run the container under
# random UID.
RUN sed -i -f /opt/app-root/nginxconf-fed.sed /etc/nginx/nginx.conf && \
mkdir -p /opt/app-root/etc/nginx.d/ && \
mkdir -p /opt/app-root/etc/nginx.default.d/ && \
chmod -R a+rwx /opt/app-root/etc && \
chmod -R a+rwx /var /run && \
chown -R 1001:0 /opt/app-root && \
chown -R 1001:0 /var
USER 1001
VOLUME ["/usr/share/nginx/html"]
VOLUME ["/var/log/nginx/"]
CMD $STI_SCRIPTS_PATH/usage