3 # - `docker build --no-cache --pull --file Dockerfile.auth-41.ubuntu-bionic --tag auth-41.ubuntu-bionic .`
4 # - `docker run -it auth-41.ubuntu-bionic`
5 # - `docker run -it auth-41.ubuntu-bionic /bin/bash`
6 # - `dnsdist --verbose 9.9.9.9`
10 # Remi contributed this snippet:
14 # readonly product=dnsdist-15
16 # for version in centos-6 centos-7 centos-8 debian-buster debian-stretch ubuntu-bionic ubuntu-xenial; do
17 # docker build --no-cache --pull --file Dockerfile.${product}.${version} --tag ${product}.${version} .
20 # for version in centos-6 centos-7 centos-8 debian-buster debian-stretch ubuntu-bionic ubuntu-xenial; do
21 # docker run -it ${product}.${version} dnsdist -v 9.9.9.9
24 if [ "$1" = "" -o "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then
25 echo "Usage: generate-repo-files.sh RELEASE"
27 echo " • RELEASE: [ auth-40 | auth-41 | auth-42 | auth-43 | auth-master |"
28 echo " rec-40 | rec-41 | rec-42 | rec-43 | rec-44 | rec-master |"
29 echo " dnsdist-15 | dnsdist-master ]"
41 cat <<EOF > Dockerfile.$RELEASE.$OS-$VERSION
44 RUN yum install -y epel-release bind-utils
47 if [ "$VERSION" = "6" -o "$VERSION" = "7" ]; then
48 cat <<EOF >> Dockerfile.$RELEASE.$OS-$VERSION
49 RUN yum install -y yum-plugin-priorities
51 elif [ "$RELEASE" = "dnsdist-15" -a "$VERSION" = "8" ]; then
52 cat <<EOF >> Dockerfile.$RELEASE.$OS-$VERSION
53 RUN dnf install -y 'dnf-command(config-manager)'
54 RUN dnf config-manager --set-enabled PowerTools
58 cat <<EOF >> Dockerfile.$RELEASE.$OS-$VERSION
59 RUN curl -o /etc/yum.repos.d/powerdns-$RELEASE.repo https://repo.powerdns.com/repo-files/$OS-$RELEASE.repo
60 RUN yum install --assumeyes --nobest $PKG
63 if [ "$RELEASE" = "rec-43" -o "$RELEASE" = "rec-44" ]; then
64 cat <<EOF >> Dockerfile.$RELEASE.$OS-$VERSION
66 RUN mkdir /var/run/pdns-recursor
70 cat <<EOF >> Dockerfile.$RELEASE.$OS-$VERSION
77 write_debian_or_ubuntu
()
84 cat <<EOF > pdns.list.$RELEASE.$OS-$VERSION
85 deb [arch=amd64] http://repo.powerdns.com/$OS $VERSION-$RELEASE main
88 # For the following two maybe only create depending on package, but
89 # it's not really a big deal.
92 cat <<EOF > dnsdist.debian-and-ubuntu
94 Pin: origin repo.powerdns.com
99 cat <<EOF > pdns.debian-and-ubuntu
101 Pin: origin repo.powerdns.com
105 cat <<EOF > Dockerfile.$RELEASE.$OS-$VERSION
109 RUN apt-get install -y curl gnupg dnsutils apt-transport-https
111 COPY dnsdist.debian-and-ubuntu /etc/apt/preferences.d/dnsdist
112 COPY pdns.debian-and-ubuntu /etc/apt/preferences.d/pdns
113 COPY pdns.list.$RELEASE.$OS-$VERSION /etc/apt/sources.list.d/pdns.list
115 RUN curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
116 RUN curl https://repo.powerdns.com/CBC8B383-pub.asc | apt-key add -
118 RUN apt-get install -y $PKG
121 if [ "$RELEASE" = "rec-43" -o "$RELEASE" = "rec-44" ]; then
122 cat <<EOF >> Dockerfile.$RELEASE.$OS-$VERSION
124 RUN mkdir /var/run/pdns-recursor
128 cat <<EOF >> Dockerfile.$RELEASE.$OS-$VERSION
137 write_debian_or_ubuntu debian
$1 $2 $3
143 write_debian_or_ubuntu ubuntu
$1 $2 $3
149 if [ "$RELEASE" = "auth-40" ]; then
150 write_centos
6 pdns pdns_server
151 write_centos
7 pdns pdns_server
152 write_debian jessie pdns-server pdns_server
153 write_debian stretch pdns-server pdns_server
154 write_ubuntu trusty pdns-server pdns_server
155 write_ubuntu xenial pdns-server pdns_server
156 elif [ "$RELEASE" = "auth-41" ]; then
157 write_centos
6 pdns pdns_server
158 write_centos
7 pdns pdns_server
159 write_debian jessie pdns-server pdns_server
160 write_debian stretch pdns-server pdns_server
161 write_ubuntu trusty pdns-server pdns_server
162 write_ubuntu xenial pdns-server pdns_server
163 write_ubuntu bionic pdns-server pdns_server
164 elif [ "$RELEASE" = "auth-42" -o "$RELEASE" = "auth-43" -o "$RELEASE" = "auth-master" ]; then
165 write_centos
6 pdns pdns_server
166 write_centos
7 pdns pdns_server
167 write_centos
8 pdns pdns_server
168 write_debian stretch pdns-server pdns_server
169 write_debian buster pdns-server pdns_server
170 write_ubuntu xenial pdns-server pdns_server
171 write_ubuntu bionic pdns-server pdns_server
172 elif [ "$RELEASE" = "rec-40" ]; then
173 write_centos
6 pdns-recursor pdns_recursor
174 write_centos
7 pdns-recursor pdns_recursor
175 write_debian jessie pdns-recursor pdns_recursor
176 write_debian stretch pdns-recursor pdns_recursor
177 write_ubuntu trusty pdns-recursor pdns_recursor
178 write_ubuntu xenial pdns-recursor pdns_recursor
179 elif [ "$RELEASE" = "rec-41" ]; then
180 write_centos
6 pdns-recursor pdns_recursor
181 write_centos
7 pdns-recursor pdns_recursor
182 write_debian jessie pdns-recursor pdns_recursor
183 write_debian stretch pdns-recursor pdns_recursor
184 write_ubuntu trusty pdns-recursor pdns_recursor
185 write_ubuntu xenial pdns-recursor pdns_recursor
186 write_ubuntu bionic pdns-recursor pdns_recursor
187 elif [ "$RELEASE" = "rec-42" -o "$RELEASE" = "rec-43" -o "$RELEASE" = "rec-44" -o "$RELEASE" = "rec-master" ]; then
188 write_centos
6 pdns-recursor pdns_recursor
189 write_centos
7 pdns-recursor pdns_recursor
190 write_centos
8 pdns-recursor pdns_recursor
191 write_debian stretch pdns-recursor pdns_recursor
192 write_debian buster pdns-recursor pdns_recursor
193 write_ubuntu xenial pdns-recursor pdns_recursor
194 write_ubuntu bionic pdns-recursor pdns_recursor
195 elif [ "$RELEASE" = "dnsdist-15" -o "$RELEASE" = "dnsdist-master" ]; then
196 write_centos
6 dnsdist dnsdist
197 write_centos
7 dnsdist dnsdist
198 write_centos
8 dnsdist dnsdist
199 write_debian stretch dnsdist dnsdist
200 write_debian buster dnsdist dnsdist
201 write_ubuntu xenial dnsdist dnsdist
202 write_ubuntu bionic dnsdist dnsdist
204 echo "Invalid release: $RELEASE"