-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
66 lines (56 loc) · 1.44 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM registry.access.redhat.com/ubi8/ubi:latest
CMD /bin/bash
RUN useradd user
WORKDIR /app
RUN yum -y install \
autoconf \
automake \
binutils \
gcc \
gcc-c++ \
git \
glibc-devel \
glibc-langpack-en \
jq \
libcurl-devel \
libtool \
make \
perl-App-cpanminus \
pkgconf \
zlib-devel
# Common Perl development tools
RUN cpanm --notest App::cpm
# If we automatically use the latest release, then we
# won't get the benefit of cache invalidation.
# We should perhaps just specify the version we
# want; referencing the lastest will potentially
# break things across major updates too, assuming
# that libmaxminddb is using semantic versioning.
# MaxMind's libmaxminddb
# https://github.com/maxmind/libmaxminddb/releases
ARG libmaxminddb_version=1.9.1
RUN set -e -x; \
git clone --recursive https://github.com/maxmind/libmaxminddb; \
cd libmaxminddb/; \
echo "using release ${libmaxminddb_version}"; \
git checkout ${libmaxminddb_version}; \
./bootstrap; \
./configure; \
make; \
make check; \
make install; \
ldconfig
# MaxMind's Perl MMDB writer support etc.
# Specify --global so it doesn't go in /app,
# which we often overshadow with a bind mount.
COPY cpanfile /app
RUN cpm install --global --without-test
COPY app/ /app/
COPY input/ /input/
COPY output/ /output/
COPY test/ /test/
RUN \
chmod +x /app/json-to-mmdb
RUN cd /; /test/libs/bats/bin/bats -r /test/spec/
ENTRYPOINT ["/app/json-to-mmdb"]
USER user