-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
163 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,37 +3,34 @@ FROM hyperknot/baseimage16:1.0.1 | |
MAINTAINER [email protected] | ||
|
||
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 \ | ||
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive \ | ||
NGINX_VERSION=1.13.0-1~xenial | ||
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive | ||
|
||
ADD ./build/nginx_1.13.1-1~xenial_amd64.deb /tmp | ||
|
||
# start | ||
RUN \ | ||
cd /tmp \ | ||
|
||
# add nginx repo | ||
&& curl -s https://nginx.org/keys/nginx_signing.key | apt-key add - \ | ||
&& cp /etc/apt/sources.list /etc/apt/sources.list.bak \ | ||
&& echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \ | ||
&& echo "deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \ | ||
|
||
# update repo, install nginx and module to get dependencies | ||
&& apt-get update -y && apt-get upgrade -y \ | ||
&& apt-get update -y && apt-get upgrade -y --no-install-recommends --no-install-suggests \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
nano nginx=1.13.0-1~xenial \ | ||
nginx-module-geoip=1.13.0-1~xenial \ | ||
nginx-module-image-filter=1.13.0-1~xenial \ | ||
gettext-base \ | ||
nano libgd3 gettext-base unzip \ | ||
&& dpkg --configure -a \ | ||
|
||
&& dpkg -i nginx_1.13.1-1~xenial_amd64.deb \ | ||
|
||
# re-enable all default services | ||
&& rm -f /etc/service/syslog-forwarder/down \ | ||
&& rm -f /etc/service/cron/down \ | ||
&& rm -f /etc/service/syslog-ng/down \ | ||
&& rm -f /core \ | ||
|
||
# geoip stuff | ||
&& cd /tmp \ | ||
&& curl http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | gzip -d - > /etc/nginx/GeoLiteCity.dat \ | ||
|
||
# forward request and error logs to docker log collector | ||
&& ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log \ | ||
|
@@ -42,13 +39,10 @@ RUN \ | |
# cleanup | ||
&& apt-get clean -y && apt-get autoclean -y \ | ||
&& apt-get autoremove --purge -y \ | ||
&& rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* \ | ||
|
||
# remove existing image filter module so we can overwrite with ours | ||
&& rm -rf /etc/nginx/modules/ngx_http_image_filter_m*.so | ||
&& rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/* | ||
|
||
ADD ./files / | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["/sbin/my_init"] |
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 |
---|---|---|
|
@@ -2,49 +2,22 @@ FROM hyperknot/baseimage16:1.0.1 | |
|
||
MAINTAINER [email protected] | ||
|
||
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive NGINX_VERSION=1.13.0 NGINX_BUILD_DIR=/tmp/nginx | ||
ENV IMAGE_FILTER_URL=https://raw.githubusercontent.com/niiknow/docker-nginx-image-proxy/master/build/src/ngx_http_image_filter_module.c | ||
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 \ | ||
TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive | ||
|
||
# start | ||
RUN \ | ||
apt-get update && apt-get upgrade -y --force-yes --no-install-recommends \ | ||
&& apt-get install -y --force-yes --no-install-recommends wget curl unzip nano vim apt-transport-https \ | ||
apt-utils software-properties-common build-essential ca-certificates libssl-dev \ | ||
zlib1g-dev dpkg-dev libpcre3 libpcre3-dev libgd-dev \ | ||
|
||
&& dpkg --configure -a \ | ||
|
||
# re-enable all default services | ||
&& rm -f /etc/service/syslog-forwarder/down \ | ||
&& rm -f /etc/service/cron/down \ | ||
&& rm -f /etc/service/syslog-ng/down \ | ||
&& rm -f /core \ | ||
&& wget -O - http://nginx.org/keys/nginx_signing.key | apt-key add - \ | ||
&& cp /etc/apt/sources.list /etc/apt/sources.list.bak \ | ||
&& echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \ | ||
&& echo "deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list \ | ||
&& apt-get update \ | ||
|
||
# recompile nginx | ||
&& mkdir -p ${NGINX_BUILD_DIR} \ | ||
|
||
# get the source | ||
&& cd ${NGINX_BUILD_DIR}; apt-get source nginx -y \ | ||
&& mv ${NGINX_BUILD_DIR}/nginx-${NGINX_VERSION}/src/http/modules/ngx_http_image_filter_module.c ${NGINX_BUILD_DIR}/nginx-${NGINX_VERSION}/src/http/modules/ngx_http_image_filter_module.bak \ | ||
ADD ./ubuntu.sh /tmp/ | ||
|
||
# apply patch | ||
&& curl -SL $IMAGE_FILTER_URL --output ${NGINX_BUILD_DIR}/nginx-${NGINX_VERSION}/src/http/modules/ngx_http_image_filter_module.c \ | ||
&& sed -i "s/--with-http_ssl_module/--with-http_ssl_module --with-http_image_filter_module=dynamic/g" ${NGINX_BUILD_DIR}/nginx-${NGINX_VERSION}/debian/rules \ | ||
|
||
# get build dependencies | ||
&& cd ${NGINX_BUILD_DIR}; apt-get build-dep nginx -y \ | ||
&& cd ${NGINX_BUILD_DIR}/nginx-${NGINX_VERSION}; dpkg-buildpackage -b \ | ||
|
||
# install new nginx package | ||
&& cd ${NGINX_BUILD_DIR}; dpkg -i nginx_${NGINX_VERSION}-1~xenial_amd64.deb | ||
# start | ||
RUN \ | ||
cd /tmp \ | ||
&& bash ubuntu.sh | ||
|
||
ADD ./files / | ||
# docker run -it imageid /bin/bash | ||
# ftp passive | ||
|
||
EXPOSE 80 | ||
VOLUME ["/backup"] | ||
|
||
CMD ["/sbin/my_init"] |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
export NGINX_VERSION=1.13.1 | ||
export IMAGE_FILTER_URL=https://gist.githubusercontent.com/noogen/4a662ade2d9570f8996f3af9869c5216/raw/54ff0a221a069a3c2574b0404afb71552fd4066d/ngx_http_image_filter_module.c | ||
export NGINX_BUILD_DIR=/usr/src/nginx/nginx-${NGINX_VERSION} | ||
|
||
cd /tmp | ||
curl -s https://nginx.org/keys/nginx_signing.key | apt-key add - | ||
cp /etc/apt/sources.list /etc/apt/sources.list.bak | ||
echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list | ||
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | tee -a /etc/apt/sources.list | ||
|
||
apt-get update && apt-get upgrade -y --no-install-recommends --no-install-suggests | ||
apt-get install -y --no-install-recommends --no-install-suggests curl unzip nano vim apt-transport-https \ | ||
apt-utils software-properties-common build-essential ca-certificates libssl-dev \ | ||
zlib1g-dev dpkg-dev libpcre3 libpcre3-dev libgd-dev ftp | ||
|
||
dpkg --configure -a | ||
|
||
mkdir -p /usr/src/nginx | ||
|
||
cd /usr/src/nginx | ||
apt-get source nginx=${NGINX_VERSION} -y | ||
mv ${NGINX_BUILD_DIR}/src/http/modules/ngx_http_image_filter_module.c ${NGINX_BUILD_DIR}/src/http/modules/ngx_http_image_filter_module.bak | ||
|
||
curl -SL $IMAGE_FILTER_URL --output ${NGINX_BUILD_DIR}/src/http/modules/ngx_http_image_filter_module.c | ||
sed -i "s/--with-http_ssl_module/--with-http_ssl_module --with-http_image_filter_module/g" ${NGINX_BUILD_DIR}/debian/rules | ||
|
||
cd /usr/src/nginx | ||
apt-get build-dep nginx -y | ||
cd ${NGINX_BUILD_DIR} | ||
dpkg-buildpackage -uc -us -b |
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
Oops, something went wrong.