Skip to content

Instantly share code, notes, and snippets.

@akrylysov
Created March 26, 2018 17:06
Show Gist options
  • Save akrylysov/fe6fb95bd6a0ce781ebd40a4ddf93efd to your computer and use it in GitHub Desktop.
Save akrylysov/fe6fb95bd6a0ce781ebd40a4ddf93efd to your computer and use it in GitHub Desktop.
FROM ubuntu:16.04
RUN echo "deb http://ppa.launchpad.net/maxmind/ppa/ubuntu trusty main" > /etc/apt/sources.list.d/maxmind.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "DE742AFA" \
&& apt-get update \
&& apt-get install -y cron geoipupdate \
&& apt-get -qy autoremove \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*
RUN touch /var/log/cron.log
RUN (crontab -l ; echo "15 0 * * * geoipupdate -v > /proc/1/fd/1 2>/proc/1/fd/2") | crontab
COPY GeoIP.conf /etc/GeoIP.conf
CMD ["/bin/bash", "-c", "geoipupdate -v; cron -f"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment