forked from maxmind/geoipupdate-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (30 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
33 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# create container stage to build out package
FROM alpine:3.6
# copy the source code into the container
COPY ./ /tmp/geoipupdate/
# run all of our commands inside the project source code
WORKDIR /tmp/geoipupdate
# install the development dependencies needed to compile the project
RUN apk add --update \
autoconf \
automake \
libtool \
alpine-sdk \
zlib-dev \
curl-dev
# build the project
RUN ./bootstrap
RUN ./configure
RUN make
RUN make install
# create a new image that contains only the binary
FROM alpine:3.6
# install the libraries needed to run the project
RUN apk add --update libcurl zlib
# copy over the compiled project files from the build step
COPY --from=0 /usr/local/bin/geoipupdate /usr/local/bin/geoipupdate
COPY --from=0 /usr/local/etc/GeoIP.conf /usr/local/etc/GeoIP.conf
COPY --from=0 /usr/local/share/doc/geoipupdate /usr/local/share/doc/geoipupdate
COPY --from=0 /usr/local/share/GeoIP /usr/local/share/GeoIP
# use the binary as the entrypoint for the image
ENTRYPOINT ["/usr/local/bin/geoipupdate"]