| 1 |
FROM golang:latest |
| 2 |
|
| 3 |
LABEL maintainer="[email protected]" |
| 4 |
|
| 5 |
ADD . /go/mirrorbits |
| 6 |
|
| 7 |
RUN apt-get update -y && \ |
| 8 |
DEBIAN_FRONTEND=noninteractive apt-get install -y pkg-config zlib1g-dev protobuf-compiler libprotoc-dev rsync && \ |
| 9 |
apt-get clean |
| 10 |
RUN go get -u github.com/maxmind/geoipupdate2/cmd/geoipupdate && \ |
| 11 |
go install -ldflags "-X main.defaultConfigFile=/etc/GeoIP.conf -X main.defaultDatabaseDirectory=/usr/share/GeoIP" github.com/maxmind/geoipupdate2/cmd/geoipupdate && \ |
| 12 |
echo "AccountID 0\nLicenseKey 000000000000\nEditionIDs GeoLite2-City GeoLite2-Country GeoLite2-ASN" > /etc/GeoIP.conf && \ |
| 13 |
mkdir /usr/share/GeoIP && \ |
| 14 |
/go/bin/geoipupdate |
| 15 |
RUN mkdir /srv/repo /var/log/mirrorbits && \ |
| 16 |
cd /go/mirrorbits && \ |
| 17 |
make install PREFIX=/usr |
| 18 |
RUN cp /go/mirrorbits/contrib/docker/mirrorbits.conf /etc/mirrorbits.conf |
| 19 |
|
| 20 |
ENTRYPOINT /usr/bin/mirrorbits daemon -config /etc/mirrorbits.conf |
| 21 |
|
| 22 |
EXPOSE 8080 |