FROM alpine:edge LABEL maintainer="Mike Crute " # TODO: Is this really needed? # apk add perl-net-ssleay RUN set -euxo pipefail; \ # Install build dependencies apk add --virtual .build-deps \ build-base \ git \ perl-app-cpanminus \ perl-dev \ wget \ ; \ apk add \ curl \ ; \ \ # Install awstats git clone https://github.com/eldy/awstats.git /opt/awstats; \ cpanm -n Net::IP Net::DNS; \ mkdir /etc/awstats; \ \ # Install MaxMind GeoIP2 library apk add perl-net-ssleay; \ cpanm -n \ Data::Validate::IP \ HTTP::Headers \ HTTP::Request \ HTTP::Response \ HTTP::Status \ JSON::MaybeXS \ List::SomeUtils \ LWP::Protocol::https \ LWP::UserAgent \ MaxMind::DB::Metadata \ MaxMind::DB::Reader \ Moo \ Moo::Role \ namespace::clean \ Params::Validate \ Path::Class \ Sub::Quote \ Test::Fatal \ Test::Number::Delta \ Throwable::Error \ Try::Tiny URI \ ; \ \ git clone https://github.com/maxmind/GeoIP2-perl.git /tmp/GeoIP2-perl; \ cd /tmp/GeoIP2-perl; \ perl Makefile.PL; \ make all install; \ mkdir /geoip; \ rm -rf /tmp/GeoIP2-perl; \ \ # Cleanup apk del .build-deps; \ rm -rf /root/.cpanm/ /var/cache/apk/*; ADD main /serve ADD build.sh /build CMD [ "/serve" ]