]>
Commit | Line | Data |
---|---|---|
927e24d4 | 1 | FROM dist-base as package-builder |
2cfaffcc | 2 | RUN yum install -y rpm-build rpmdevtools /usr/bin/python3 && \ |
927e24d4 PL |
3 | yum groupinstall -y "Development Tools" && \ |
4 | rpmdev-setuptree | |
5 | ||
6 | RUN mkdir /dist /pdns | |
7 | WORKDIR /pdns | |
8 | RUN rpmdev-setuptree | |
9 | ||
10 | # Only ADD/COPY the files you really need for efficient docker caching. | |
11 | ADD builder/helpers/ /pdns/builder/helpers/ | |
12 | ||
13 | # Used for -p option to only build specific spec files | |
14 | ARG BUILDER_PACKAGE_MATCH | |
15 | ||
16 | ARG BUILDER_VERSION | |
17 | ARG BUILDER_RELEASE | |
18 | COPY --from=sdist /sdist /sdist | |
19 | RUN for file in /sdist/* ; do ln -s $file /root/rpmbuild/SOURCES/ ; done && ls /root/rpmbuild/SOURCES/ | |
20 | ||
21 | ADD builder-support/specs/ /pdns/builder-support/specs | |
22 | RUN find /pdns/builder-support/specs/ -not -name '*.spec' -exec ln -s {} /root/rpmbuild/SOURCES/ \; | |
23 | ||
308fb37a | 24 | @IF [ ! -z "$M_authoritative$M_all" ] |
927e24d4 | 25 | RUN if $(grep -q 'release 6' /etc/redhat-release); then \ |
d17799c9 | 26 | scl enable devtoolset-7 -- builder/helpers/build-specs.sh builder-support/specs/pdns.spec; \ |
927e24d4 PL |
27 | else \ |
28 | builder/helpers/build-specs.sh builder-support/specs/pdns.spec; \ | |
29 | fi | |
30 | @ENDIF | |
31 | ||
308fb37a | 32 | @IF [ ! -z "$M_recursor$M_all" ] |
9d52f503 | 33 | RUN if $(grep -q 'release 6' /etc/redhat-release); then \ |
d17799c9 | 34 | scl enable devtoolset-7 -- builder/helpers/build-specs.sh builder-support/specs/pdns-recursor.spec; \ |
9d52f503 PL |
35 | else \ |
36 | builder/helpers/build-specs.sh builder-support/specs/pdns-recursor.spec; \ | |
37 | fi | |
38 | @ENDIF | |
39 | ||
308fb37a | 40 | @IF [ ! -z "$M_dnsdist$M_all" ] |
e2c9d5cf | 41 | RUN if $(grep -q 'release 6' /etc/redhat-release); then \ |
b4a7e6b2 | 42 | true ; \ |
e2c9d5cf | 43 | else \ |
fbf14b03 RG |
44 | mkdir /libh2o && cd /libh2o && \ |
45 | yum install -y curl openssl-devel cmake && \ | |
46 | curl -L https://github.com/h2o/h2o/archive/v2.2.5.tar.gz | tar xz && \ | |
47 | CFLAGS='-fPIC' cmake -DWITH_PICOTLS=off -DWITH_BUNDLED_SSL=off -DWITH_MRUBY=off -DCMAKE_INSTALL_PREFIX=/opt ./h2o-2.2.5 && \ | |
48 | make install && \ | |
b4a7e6b2 PL |
49 | cd /pdns; \ |
50 | fi | |
51 | ||
52 | RUN if $(grep -q 'release 6' /etc/redhat-release); then \ | |
53 | scl enable devtoolset-7 -- builder/helpers/build-specs.sh builder-support/specs/dnsdist.spec; \ | |
54 | else \ | |
e2c9d5cf PL |
55 | builder/helpers/build-specs.sh builder-support/specs/dnsdist.spec; \ |
56 | fi | |
57 | @ENDIF | |
58 | ||
927e24d4 PL |
59 | # mv accross layers with overlay2 is buggy in some kernel versions (results in empty dirs) |
60 | # See: https://github.com/moby/moby/issues/33733 | |
61 | #RUN mv /root/rpmbuild/RPMS/* /dist/ | |
62 | RUN cp -R /root/rpmbuild/RPMS/* /dist/ | |
4ae1c008 | 63 | RUN cp -R /root/rpmbuild/SRPMS/* /dist/ |