FROM registry.fedoraproject.org/f25/s2i-base:latest # nginx 1.10 image. # # Volumes: # * /var/log/nginx/ - Storage for logs EXPOSE 8080 EXPOSE 8443 ENV NAME=nginx \ NGINX_VERSION=1.10 \ VERSION=0 \ RELEASE=1 \ 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,nginx10" \ com.redhat.component="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ release="$RELEASE.$DISTTAG" \ architecture="$ARCH" \ usage="s2i build file:///your/app 25/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 # Each language image can have 'contrib' a directory with extra files needed to # run and build the applications. COPY ./contrib/ /opt/app-root # Add help.1 file 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