-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
36 lines (31 loc) · 1.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM nginx:1.11
MAINTAINER David Galoyan <[email protected]>
ENV NGX_CACHE_PURGE_VERSION=2.4.1
# Install basic packages and build tools
RUN apt-get update && \
apt-get install --no-install-recommends --no-install-suggests -y \
wget \
build-essential \
libssl-dev \
libpcre3 \
libpcre3-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# download and extract sources
RUN NGINX_VERSION=`nginx -V 2>&1 | grep "nginx version" | awk -F/ '{ print $2}'` && \
cd /tmp && \
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
wget https://github.com/nginx-modules/ngx_cache_purge/archive/$NGX_CACHE_PURGE_VERSION.tar.gz \
-O ngx_cache_purge-$NGX_CACHE_PURGE_VERSION.tar.gz && \
tar -xf nginx-$NGINX_VERSION.tar.gz && \
mv nginx-$NGINX_VERSION nginx && \
rm nginx-$NGINX_VERSION.tar.gz && \
tar -xf ngx_cache_purge-$NGX_CACHE_PURGE_VERSION.tar.gz && \
mv ngx_cache_purge-$NGX_CACHE_PURGE_VERSION ngx_cache_purge && \
rm ngx_cache_purge-$NGX_CACHE_PURGE_VERSION.tar.gz
# configure and build
RUN cd /tmp/nginx && \
BASE_CONFIGURE_ARGS=`nginx -V 2>&1 | grep "configure arguments" | cut -d " " -f 3-` && \
/bin/sh -c "./configure ${BASE_CONFIGURE_ARGS} --add-module=/tmp/ngx_cache_purge" && \
make && make install && \
rm -rf /tmp/nginx*