This commit is contained in:
Alessandro Lucaferro 2018-02-12 08:37:54 +00:00 committed by GitHub
commit a3075f3ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 1 deletions

View File

@ -80,7 +80,7 @@ force IPv4 or IPv6 lookup.
Compiling requires the [Golang compiler](https://golang.org/) to be installed.
This application can be installed by using `go get`:
`go get github.com/mpolden/ipd`
`go get github.com/mpolden/ipd/cmd/ipd`
For more information on building a Go project, see the [official Go
documentation](https://golang.org/doc/code.html).

35
docker/Dockerfile Normal file
View File

@ -0,0 +1,35 @@
FROM golang:alpine as build-env
RUN apk --no-cache add git
RUN go get github.com/mpolden/ipd
FROM alpine as geoipupdate-env
RUN apk add -q --update alpine-sdk curl-dev file wget zlib-dev git autoconf automake libtool\
&& mkdir -p /tmp/geoipupdate && cd /tmp/geoipupdate \
&& git clone --depth=1 https://github.com/maxmind/geoipupdate.git . \
&& ./bootstrap \
&& ./configure \
&& make \
&& make install \
&& mkdir -p /tmp/geoip \
&& geoipupdate -d /tmp/geoip
FROM alpine
MAINTAINER Alessandro Lucaferro <alessandro.lucaferro@gmail.com>
RUN mkdir ipd
WORKDIR /ipd
COPY --from=build-env /go/bin/ipd /ipd/ipd
COPY --from=geoipupdate-env /tmp/geoip/* /ipd/
ENTRYPOINT ["/ipd/ipd"]
EXPOSE 8080

14
docker/README.md Normal file
View File

@ -0,0 +1,14 @@
# Ipd Docker
## Build
docker build -t ipd .
## Run
docker run -p 8080:8080 ipd
### Run with GeoIp databases (from docker container)
docker run -p 8080:8080 ipd -c ./GeoLite2-City.mmdb -f ./GeoLite2-Country.mmdb