Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 8 additions & 6 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ RUN apt-get update && \
supervisor \
shibboleth-sp-common \
shibboleth-sp-utils \
php-fpm php-curl
fcgiwrap \
python3-requests

WORKDIR /tmp
# dpkg-buildpackage names the .deb after the build host architecture
Expand All @@ -58,11 +59,13 @@ RUN dpkg -i nginx_1.20.1-1~focal_*.deb


ADD supervisord.conf /etc/supervisor/supervisord.conf
# supervisord.conf points shibauthorizer / shibresponder at the x86_64
# library directory. Rewrite it for the build architecture (e.g. aarch64).
RUN sed -i "s#/usr/lib/x86_64-linux-gnu/shibboleth/#/usr/lib/$(uname -m)-linux-gnu/shibboleth/#g" \
/etc/supervisor/supervisord.conf
ADD shibboleth2.xml /etc/shibboleth/shibboleth2.xml
ADD attribute-map.xml /etc/shibboleth/attribute-map.xml
ADD attribute-policy.xml /etc/shibboleth/attribute-policy.xml
RUN sed -i 's/\/run\/php/\/tmp/g' /etc/php/7.4/fpm/php-fpm.conf && \
sed -i 's/\/run\/php/\/tmp/g' /etc/php/7.4/fpm/pool.d/www.conf

ADD ./keys/server.crt /etc/shibboleth/server.crt
ADD ./keys/server.key /etc/shibboleth/server.key
Expand All @@ -82,9 +85,8 @@ ADD redirect_list.map /etc/nginx/redirect_list.map
RUN chmod 400 /etc/nginx/server.key

RUN mkdir /usr/share/nginx/html/secure
#ADD ./phpinfo.php /usr/share/nginx/html/secure/phpinfo.php
#ADD ./index.php /usr/share/nginx/html/secure/index.php
ADD ./login.php /usr/share/nginx/html/secure/login.php
ADD ./login.py /usr/share/nginx/html/secure/login.py
RUN chmod 755 /usr/share/nginx/html/secure/login.py

ADD ./shib_clear_headers /etc/nginx/shib_clear_headers
ADD ./shib_fastcgi_params /etc/nginx/shib_fastcgi_params
Expand Down
31 changes: 11 additions & 20 deletions nginx/Dockerfile.ams
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ RUN apt-get update -y && \
RUN echo "deb http://nginx.org/packages/ubuntu focal nginx" | tee /etc/apt/sources.list.d/nginx.list
RUN echo "deb-src http://nginx.org/packages/ubuntu focal nginx" | tee -a /etc/apt/sources.list.d/nginx.list
RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
#RUN apt-get source -y nginx=1.18.0
#RUN apt-get build-dep -y nginx=1.18.0
RUN apt-get update -y && \
apt-get source -y nginx=1.20.1 && \
apt-get build-dep -y nginx=1.20.1
Expand All @@ -19,42 +17,37 @@ RUN wget "https://github.com/samizdatco/nginx-http-auth-digest/archive/master.zi
# https://github.com/nginx-shib/nginx-http-shibboleth
RUN wget "https://github.com/nginx-shib/nginx-http-shibboleth/archive/v2.0.1.tar.gz" -O nginx-http-shibboleth-2.0.1.tar.gz
RUN wget "https://github.com/openresty/headers-more-nginx-module/archive/v0.33.tar.gz" -O headers-more-nginx-module-0.33.tar.gz
RUN wget "https://github.com/apache/incubator-pagespeed-ngx/archive/v1.13.35.2-stable.tar.gz" -O incubator-pagespeed-ngx-1.13.35.2-stable.tar.gz
RUN wget "https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz" -O ngx_cache_purge-2.3.tar.gz

RUN unzip nginx-http-auth-digest.zip && \
tar zxf nginx-http-shibboleth-2.0.1.tar.gz && \
tar zxf headers-more-nginx-module-0.33.tar.gz && \
tar zxvf incubator-pagespeed-ngx-1.13.35.2-stable.tar.gz && \
tar zxf ngx_cache_purge-2.3.tar.gz

RUN cd /tmp/incubator-pagespeed-ngx-1.13.35.2-stable ; wget https://dl.google.com/dl/page-speed/psol/1.13.35.2-x64.tar.gz ; tar -xzvf 1.13.35.2-x64.tar.gz
#RUN sed -i "s#--modules-path=/usr/lib/nginx/modules#--modules-path=/usr/lib/nginx/modules --add-module=/tmp/headers-more-nginx-module-0.33 --add-module=/tmp/nginx-http-shibboleth-2.0.1 --add-module=/tmp/nginx-http-auth-digest-master --add-module=/tmp/incubator-pagespeed-ngx-1.13.35.2-stable --add-module=/tmp/ngx_cache_purge-2.3 #g" nginx-1.18.0/debian/rules
#RUN cd nginx-1.18.0 && dpkg-buildpackage -b
RUN sed -i "s#--modules-path=/usr/lib/nginx/modules#--modules-path=/usr/lib/nginx/modules --add-module=/tmp/headers-more-nginx-module-0.33 --add-module=/tmp/nginx-http-shibboleth-2.0.1 --add-module=/tmp/nginx-http-auth-digest-master --add-module=/tmp/incubator-pagespeed-ngx-1.13.35.2-stable --add-module=/tmp/ngx_cache_purge-2.3 #g" nginx-1.20.1/debian/rules
RUN sed -i "s#--modules-path=/usr/lib/nginx/modules#--modules-path=/usr/lib/nginx/modules --add-module=/tmp/headers-more-nginx-module-0.33 --add-module=/tmp/nginx-http-shibboleth-2.0.1 --add-module=/tmp/nginx-http-auth-digest-master --add-module=/tmp/ngx_cache_purge-2.3 #g" nginx-1.20.1/debian/rules
RUN cd nginx-1.20.1 && dpkg-buildpackage -b

FROM ubuntu:focal AS nginx-stage_1

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y openssl wget curl unzip supervisor shibboleth-sp-common shibboleth-sp-utils php-fpm php-curl fcgiwrap python3-pip
RUN pip3 install requests
RUN apt-get update && apt-get install -y openssl wget curl unzip supervisor shibboleth-sp-common shibboleth-sp-utils fcgiwrap python3-requests

WORKDIR /tmp
#COPY --from=nginx-with-shib /tmp/nginx_1.18.0-2~focal_amd64.deb .
#COPY --from=nginx-with-shib /tmp/nginx-dbg_1.18.0-2~focal_amd64.deb .
#RUN dpkg -i nginx_1.18.0-2~focal_amd64.deb
COPY --from=nginx-with-shib /tmp/nginx_1.20.1-1~focal_amd64.deb .
COPY --from=nginx-with-shib /tmp/nginx-dbg_1.20.1-1~focal_amd64.deb .
RUN dpkg -i nginx_1.20.1-1~focal_amd64.deb
# dpkg-buildpackage names the .deb after the build host architecture
# (amd64 / arm64), so match it with a wildcard instead of hard-coding it.
COPY --from=nginx-with-shib /tmp/nginx_1.20.1-1~focal_*.deb ./
COPY --from=nginx-with-shib /tmp/nginx-dbg_1.20.1-1~focal_*.deb ./
RUN dpkg -i nginx_1.20.1-1~focal_*.deb


ADD supervisord.conf /etc/supervisor/supervisord.conf
# supervisord.conf points shibauthorizer / shibresponder at the x86_64
# library directory. Rewrite it for the build architecture (e.g. aarch64).
RUN sed -i "s#/usr/lib/x86_64-linux-gnu/shibboleth/#/usr/lib/$(uname -m)-linux-gnu/shibboleth/#g" \
/etc/supervisor/supervisord.conf
ADD shibboleth2.xml /etc/shibboleth/shibboleth2.xml
ADD attribute-map.xml /etc/shibboleth/attribute-map.xml
ADD attribute-policy.xml /etc/shibboleth/attribute-policy.xml
RUN sed -i 's/\/run\/php/\/tmp/g' /etc/php/7.4/fpm/php-fpm.conf
RUN sed -i 's/\/run\/php/\/tmp/g' /etc/php/7.4/fpm/pool.d/www.conf

ADD ./keys/server.crt /etc/shibboleth/server.crt
ADD ./keys/server.key /etc/shibboleth/server.key
Expand All @@ -75,8 +68,6 @@ ADD redirect_list.map /etc/nginx/redirect_list.map
RUN chmod 400 /etc/nginx/server.key

RUN mkdir /usr/share/nginx/html/secure
#ADD ./phpinfo.php /usr/share/nginx/html/secure/phpinfo.php
#ADD ./index.php /usr/share/nginx/html/secure/index.php
ADD ./login.py /usr/share/nginx/html/secure/login.py
RUN chmod 755 /usr/share/nginx/html/secure/login.py

Expand Down
14 changes: 8 additions & 6 deletions nginx/Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ RUN apt-get update && \
supervisor \
shibboleth-sp-common \
shibboleth-sp-utils \
php-fpm php-curl
fcgiwrap \
python3-requests

WORKDIR /tmp
# dpkg-buildpackage names the .deb after the build host architecture
Expand All @@ -58,11 +59,13 @@ RUN dpkg -i nginx_1.20.1-1~focal_*.deb


ADD supervisord.conf /etc/supervisor/supervisord.conf
# supervisord.conf points shibauthorizer / shibresponder at the x86_64
# library directory. Rewrite it for the build architecture (e.g. aarch64).
RUN sed -i "s#/usr/lib/x86_64-linux-gnu/shibboleth/#/usr/lib/$(uname -m)-linux-gnu/shibboleth/#g" \
/etc/supervisor/supervisord.conf
ADD shibboleth2.xml /etc/shibboleth/shibboleth2.xml
ADD attribute-map.xml /etc/shibboleth/attribute-map.xml
ADD attribute-policy.xml /etc/shibboleth/attribute-policy.xml
RUN sed -i 's/\/run\/php/\/tmp/g' /etc/php/7.4/fpm/php-fpm.conf && \
sed -i 's/\/run\/php/\/tmp/g' /etc/php/7.4/fpm/pool.d/www.conf

ADD ./keys/server.crt /etc/shibboleth/server.crt
ADD ./keys/server.key /etc/shibboleth/server.key
Expand All @@ -82,9 +85,8 @@ ADD redirect_list.map /etc/nginx/redirect_list.map
RUN chmod 400 /etc/nginx/server.key

RUN mkdir /usr/share/nginx/html/secure
#ADD ./phpinfo.php /usr/share/nginx/html/secure/phpinfo.php
#ADD ./index.php /usr/share/nginx/html/secure/index.php
ADD ./login.php /usr/share/nginx/html/secure/login.php
ADD ./login.py /usr/share/nginx/html/secure/login.py
RUN chmod 755 /usr/share/nginx/html/secure/login.py

ADD ./shib_clear_headers /etc/nginx/shib_clear_headers
ADD ./shib_fastcgi_params /etc/nginx/shib_fastcgi_params
Expand Down
Loading
Loading