]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Docker: ensure caching works 9694/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 9 Nov 2020 19:06:18 +0000 (20:06 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 9 Nov 2020 19:16:08 +0000 (20:16 +0100)
Dockerfile-auth
Dockerfile-dnsdist
Dockerfile-recursor
Makefile.docker

index ed1856608657a15e514ce481377a57629c3ea545..42bdf88e2fe08e630093285d134759f1aeb6cf8e 100644 (file)
@@ -10,7 +10,7 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get clean
 RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y  --no-install-recommends devscripts equivs git && apt-get clean
 
 # import everything - this could be pdns.git OR an auth tarball!
-COPY . /source
+COPY builder-support /source/builder-support
 
 # TODO: control file is not in tarballs at all right now
 RUN mk-build-deps -i -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' /source/builder-support/debian/authoritative/debian-buster/control && \
@@ -19,6 +19,16 @@ RUN mk-build-deps -i -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-instal
 # build and install (TODO: before we hit this line, rearrange /source structure if we are coming from a tarball)
 WORKDIR /source/
 
+COPY pdns /source/pdns
+COPY modules /source/modules
+COPY codedocs /source/codedocs
+COPY docs /source/docs
+COPY build-aux /source/build-aux
+COPY m4 /source/m4
+COPY ext /source/ext
+COPY .git /source/.git
+ADD configure.ac Makefile.am /source/
+
 ARG MAKEFLAGS=
 ENV MAKEFLAGS ${MAKEFLAGS:--j2}
 
@@ -64,9 +74,7 @@ RUN apt install -y /tmp/equivs-dummy_1.0_all.deb && apt clean
 # Start script
 COPY dockerdata/startup.py /usr/local/sbin/pdns_server-startup
 
-# Config file(s) from builder
-# Should not grab this from builder - since it isn't being built
-COPY --from=builder /source/dockerdata/pdns.conf /etc/powerdns/
+COPY dockerdata/pdns.conf /etc/powerdns/
 RUN mkdir -p /etc/powerdns/pdns.d /var/run/pdns /var/lib/powerdns /etc/powerdns/templates.d
 
 # Work with pdns user - not root
index 98bdf0d272609d87c991b9cffcdc490cd58e26df..75dab70de0b5e5012acc34825e8df145e4a827e4 100644 (file)
@@ -9,13 +9,18 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get clean
 # devscripts gives us mk-build-deps (and a lot of other stuff)
 RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y  --no-install-recommends devscripts equivs git && apt-get clean
 
-# import everything - this could be pdns.git OR a dnsdist tarball!
-COPY . /source
+COPY builder-support /source/builder-support
 
 # TODO: control file is not in tarballs at all right now
 RUN mk-build-deps -i -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' /source/builder-support/debian/dnsdist/debian-buster/control && \
     apt-get clean
 
+COPY pdns /source/pdns
+COPY build-aux /source/build-aux
+COPY m4 /source/m4
+COPY ext /source/ext
+COPY .git /source/.git
+
 # build and install (TODO: before we hit this line, rearrange /source structure if we are coming from a tarball)
 WORKDIR /source/pdns/dnsdistdist
 
@@ -66,7 +71,7 @@ RUN apt install -y /tmp/equivs-dummy_1.0_all.deb && apt clean
 
 # Config
 RUN mkdir -p /etc/dnsdist/conf.d /etc/dnsdist/templates.d
-COPY --from=builder /source/dockerdata/dnsdist.conf /etc/dnsdist/
+COPY dockerdata/dnsdist.conf /etc/dnsdist/
 
 # Start script
 COPY dockerdata/startup.py /usr/local/bin/dnsdist-startup
@@ -86,7 +91,7 @@ EXPOSE 8083/tcp
 
 WORKDIR /etc/dnsdist
 
-COPY --from=builder /source/dockerdata/dnsdist-resolver.lua /etc/dnsdist/
-COPY --from=builder /source/dockerdata/dnsdist-resolver.py /usr/local/bin/dnsdist-resolver
+COPY dockerdata/dnsdist-resolver.lua /etc/dnsdist/
+COPY dockerdata/dnsdist-resolver.py /usr/local/bin/dnsdist-resolver
 
 ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/dnsdist-startup"]
index 57bf9a250688f7fb5e7952b06a105a05d69649ed..268417bb095c0b434a5360a2769c9922083b4089 100644 (file)
@@ -13,16 +13,19 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get clean
 # devscripts gives us mk-build-deps (and a lot of other stuff)
 RUN apt-get install -y --no-install-recommends devscripts equivs git curl && apt-get clean
 
-# import everything - this could be pdns.git OR a recursor tarball!
-COPY . /source
-
-# TODO: make sure /source looks roughly the same from git or tar
+COPY builder-support /source/builder-support
 
 # TODO: control file is not in tarballs at all right now
 RUN mk-build-deps -i -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' /source/builder-support/debian/recursor/debian-buster/control && \
     apt-get clean
 # RUN apt-get -y install protobuf-compiler && apt-get clean
 
+COPY pdns /source/pdns
+COPY build-aux /source/build-aux
+COPY m4 /source/m4
+COPY ext /source/ext
+COPY .git /source/.git
+
 # build and install (TODO: before we hit this line, rearrange /source structure if we are coming from a tarball)
 WORKDIR /source/pdns/recursordist
 
@@ -74,8 +77,7 @@ RUN apt install -y /tmp/equivs-dummy_1.0_all.deb && apt clean
 COPY dockerdata/startup.py /usr/local/sbin/pdns_recursor-startup
 
 # Config file(s) from builder
-# Should not grab this from builder - since it isn't being built
-COPY --from=builder /source/dockerdata/recursor.conf /etc/powerdns/
+COPY dockerdata/recursor.conf /etc/powerdns/
 
 # Is recursor.d necessary if we copy the config into recursor.conf? (see above)
 RUN mkdir -p /etc/powerdns/recursor.d /var/run/pdns-recursor /etc/powerdns/templates.d
index 195f88c42e2c3428e24bbeba3060ef94d91d7dd5..e882a1eb7929225cdd852d4eeb1462159fb2e100 100644 (file)
@@ -1,15 +1,22 @@
-.PHONY: all build build-nocache dep
+.PHONY: all build build-nocache dep auth recursor dnsdist
 
 VERSION=experimental
 REVISION=1
 
 all: build
 
-build:
+auth:
        docker build --build-arg VERSION=$(VERSION) -t powerdns/pdns-auth-master:$(VERSION)-$(REVISION) --rm -f Dockerfile-auth .
+
+recursor:
        docker build --build-arg VERSION=$(VERSION) -t powerdns/pdns-recursor-master:$(VERSION)-$(REVISION) --rm -f Dockerfile-recursor .
+
+dnsdist:
        docker build --build-arg VERSION=$(VERSION) -t powerdns/dnsdist-master:$(VERSION)-$(REVISION) --rm -f Dockerfile-dnsdist .
 
+build: auth recursor dnsdist
+       @true
+
 build-nocache:
        docker build --build-arg VERSION=$(VERSION) -t powerdns/pdns-auth-master:$(VERSION)-$(REVISION) --no-cache --rm -f Dockerfile-auth .
        docker build --build-arg VERSION=$(VERSION) -t powerdns/pdns-recursor-master:$(VERSION)-$(REVISION) --no-cache --rm -f Dockerfile-recursor .