diff --git a/images/nginx/Makefile b/images/nginx/Makefile index 6f050bde3..95b8c455c 100644 --- a/images/nginx/Makefile +++ b/images/nginx/Makefile @@ -13,7 +13,7 @@ # limitations under the License. # 0.0.0 shouldn't clobber any released builds -TAG ?= 0.73 +TAG ?= 0.74 REGISTRY ?= quay.io/kubernetes-ingress-controller ARCH ?= $(shell go env GOARCH) DOCKER ?= docker diff --git a/images/nginx/rootfs/build.sh b/images/nginx/rootfs/build.sh index b73842f05..1deb2b492 100755 --- a/images/nginx/rootfs/build.sh +++ b/images/nginx/rootfs/build.sh @@ -109,18 +109,16 @@ mkdir -p /etc/nginx # Get the GeoIP data GEOIP_FOLDER=/etc/nginx/geoip mkdir -p $GEOIP_FOLDER -function geoip_get { - wget -O $GEOIP_FOLDER/$1 $2 || { echo "Could not download $1, exiting." ; exit 1; } - gunzip $GEOIP_FOLDER/$1 -} + function geoip2_get { wget -O $GEOIP_FOLDER/$1.tar.gz $2 || { echo "Could not download $1, exiting." ; exit 1; } - mkdir $GEOIP_FOLDER/$1 && tar xf $GEOIP_FOLDER/$1.tar.gz -C $GEOIP_FOLDER/$1 --strip-components 1 && mv $GEOIP_FOLDER/$1/$1.mmdb $GEOIP_FOLDER/$1.mmdb && rm -rf $GEOIP_FOLDER/$1 + mkdir $GEOIP_FOLDER/$1 \ + && tar xf $GEOIP_FOLDER/$1.tar.gz -C $GEOIP_FOLDER/$1 --strip-components 1 \ + && mv $GEOIP_FOLDER/$1/$1.mmdb $GEOIP_FOLDER/$1.mmdb \ + && rm -rf $GEOIP_FOLDER/$1 \ + && rm -rf $GEOIP_FOLDER/$1.tar.gz } -geoip_get "GeoIPASNum.dat.gz" "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz" -geoip_get "GeoIP.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" -geoip_get "GeoLiteCity.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" geoip2_get "GeoLite2-City" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz" geoip2_get "GeoLite2-ASN" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz" @@ -567,6 +565,10 @@ rm -rf /etc/nginx/owasp-modsecurity-crs/util/regression-tests rm -rf $HOME/.hunter +# move geoip directory +mv /geoip/* /etc/nginx/geoip +rm -rf /geoip + # update image permissions writeDirs=( \ /etc/nginx \ diff --git a/images/nginx/rootfs/geoip/GeoIP.dat b/images/nginx/rootfs/geoip/GeoIP.dat new file mode 100644 index 000000000..be8b031f7 Binary files /dev/null and b/images/nginx/rootfs/geoip/GeoIP.dat differ diff --git a/images/nginx/rootfs/geoip/GeoIPASNum.dat b/images/nginx/rootfs/geoip/GeoIPASNum.dat new file mode 100644 index 000000000..85c2cb329 Binary files /dev/null and b/images/nginx/rootfs/geoip/GeoIPASNum.dat differ diff --git a/images/nginx/rootfs/geoip/GeoLiteCity.dat b/images/nginx/rootfs/geoip/GeoLiteCity.dat new file mode 100644 index 000000000..1adb8c3c4 Binary files /dev/null and b/images/nginx/rootfs/geoip/GeoLiteCity.dat differ