Skip to content

Commit

Permalink
Enhancement: Upgrading from goaccess 1.3 to 1.4 (#6)
Browse files Browse the repository at this point in the history
- GeoLite download strategy has changed
- Incorporate docker hub build hook for dynamic variable replacement
- Add .gitattributes to avoid issues w/ editing on Windows systems
  • Loading branch information
GregYankovoy authored Oct 2, 2020
1 parent 2cb30b1 commit efd688b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build text eol=lf
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ FROM gregyankovoy/alpine-base

ARG build_deps="build-base ncurses-dev autoconf automake git gettext-dev libmaxminddb-dev"
ARG runtime_deps="nginx tini ncurses libintl libmaxminddb"
ARG geolite_city_link="to be replaced by build agent"
ARG geolite_version="to be replaced by build agent"

WORKDIR /goaccess

# Build goaccess with mmdb geoip
RUN wget -q -O - https://github.com/allinurl/goaccess/archive/v1.3.tar.gz | tar --strip 1 -xzf - && \
RUN wget -q -O - https://github.com/allinurl/goaccess/archive/v1.4.tar.gz | tar --strip 1 -xzf - && \
apk add --update --no-cache ${build_deps} && \
autoreconf -fiv && \
./configure --enable-utf8 --enable-geoip=mmdb && \
Expand All @@ -18,7 +20,7 @@ RUN wget -q -O - https://github.com/allinurl/goaccess/archive/v1.3.tar.gz | tar
# Get necessary runtime dependencies and set up configuration
RUN apk add --update --no-cache ${runtime_deps} && \
mkdir -p /usr/local/share/GeoIP && \
wget -q -O- http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz | gunzip > /usr/local/share/GeoIP/GeoLite2-City.mmdb
wget -q -O- ${geolite_city_link} | tar -xz --strip 1 --directory /usr/local/share/GeoIP

COPY /root /

Expand Down
3 changes: 3 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker build --build-arg geolite_city_link=$geolite_city_link --build-arg geolite_version=$geolite_version -f $DOCKERFILE_PATH -t $IMAGE_NAME .

1 comment on commit efd688b

@copolycube
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @GregYankovoy be careful since the goaccess.conf changed a lot with the version 1.4 (cf. PR #16 )

Please sign in to comment.