Skip to content

Commit

Permalink
修复错误
Browse files Browse the repository at this point in the history
  • Loading branch information
andy committed Aug 5, 2021
1 parent 5521416 commit fb1c927
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ LABEL maintainer="andy"
ENV NGX_CACHE_PURGE_VERSION=2.5.1
ENV NGX_BROTLI_VERSION=v1.0.0rc

# for local build
#ENV http_proxy http://192.168.0.105:1089
#ENV https_proxy http://192.168.0.105:1089

# Install basic packages and build tools
RUN apt-get update && \
apt-get install --no-install-recommends --no-install-suggests -y \
wget \
git \
zlib1g-dev \
build-essential \
libssl-dev \
Expand All @@ -28,22 +33,25 @@ RUN NGINX_VERSION=`nginx -V 2>&1 | grep "nginx version" | awk -F/ '{ print $2}'`
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
wget https://github.com/nginx-modules/ngx_cache_purge/archive/refs/tags/$NGX_CACHE_PURGE_VERSION.tar.gz \
-O ngx_cache_purge-$NGX_CACHE_PURGE_VERSION.tar.gz && \
wget https://github.com/google/ngx_brotli/archive/refs/tags/$NGX_BROTLI_VERSION.tar.gz \
-O ngx_brotli-$NGX_BROTLI_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 && \
tar -xf ngx_brotli-$NGX_BROTLI_VERSION.tar.gz && \
mv ngx_brotli-$NGX_BROTLI_VERSION ngx_brotli && \
rm ngx_brotli-$NGX_BROTLI_VERSION.tar.gz

rm ngx_cache_purge-$NGX_CACHE_PURGE_VERSION.tar.gz

# Reuse same cli arguments as the nginx:alpine image used to build
RUN cd /tmp && \
git clone https://github.com/google/ngx_brotli.git && \
#git clone https://github.com/nginx-modules/ngx_cache_purge.git && \
cd /tmp/ngx_brotli && git submodule update --init

# 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 --add-module=/tmp/ngx_brotli" && \
make && make install && \
rm -rf /tmp/nginx*

ENV http_proxy ""
ENV https_proxy ""
8 changes: 8 additions & 0 deletions build_nginxpurge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
NGINX_VERSION=1.21

docker build \
--tag bloodstar/nginx-purge:$NGINX_VERSION \
--force-rm \
-f Dockerfile .

0 comments on commit fb1c927

Please sign in to comment.