summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 582b2148be3a2839a166b84e3e62697974b72cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM debian:stable AS build
RUN apt-get -q update && env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    build-essential pkg-config golang-go git ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# don't need to do bash tricks to keep the layers small, as this is a multi-stage build
ENV GOPATH=/go
WORKDIR $GOPATH
RUN go get 0xacab.org/leap/getmyip
RUN strip $GOPATH/bin/getmyip

FROM debian:stable
RUN echo 'deb http://deb.debian.org/debian buster contrib' > /etc/apt/sources.list.d/contrib.list
RUN apt-get -q update && env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    geoipupdate ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN cp /usr/share/doc/geoipupdate/examples/GeoIP.conf.default /etc/GeoIP.conf
RUN /usr/bin/geoipupdate
COPY --from=build /go/bin/getmyip /usr/local/bin/getmyip

ENTRYPOINT ["/usr/local/bin/getmyip", "-notls"]