Code Monkey home page Code Monkey logo

docker-powerdns's Introduction

PowerDNS Docker Container

Many thanks for all contributions, feedback and stars to this project but it is time to deprecate it in favor of the official images.


Image Size Docker Stars Docker Pulls Docker Automated buil

  • Small Alpine based Image
  • MySQL (default), Postgres, SQLite and Bind backend included
  • DNSSEC support optional
  • Automatic MySQL database initialization
  • Latest PowerDNS version (if not pls file an issue)
  • Guardian process enabled
  • Graceful shutdown using pdns_control

Supported tags

  • Exact: i.e. v4.4.1: PowerDNS Version 4.4.1
  • v4.0: PowerDNS Version 4.0.x, latest image build
  • v4: PowerDNS Version 4.x.x, latest image build

Note: Some older tags don't have the v at the beginning (e.g. for Version 4.1.7 the tag is 4.1.7)

Usage

# Start a MySQL Container
$ docker run -d \
  --name pdns-mysql \
  -e MYSQL_ROOT_PASSWORD=supersecret \
  -v $PWD/mysql-data:/var/lib/mysql \
  mariadb:10.1

$ docker run --name pdns \
  --link pdns-mysql:mysql \
  -p 53:53 \
  -p 53:53/udp \
  -e MYSQL_USER=root \
  -e MYSQL_PASS=supersecret \
  -e MYSQL_PORT=3306 \
  psitrax/powerdns \
    --cache-ttl=120 \
    --allow-axfr-ips=127.0.0.1,123.1.2.3

Configuration

Environment Configuration:

  • MySQL connection settings
    • MYSQL_HOST=mysql
    • MYSQL_USER=root
    • MYSQL_PASS=root
    • MYSQL_DB=pdns
    • MYSQL_DNSSEC=no
  • To support docker secrets, use same variables as above with suffix _FILE.
  • Want to disable mysql initialization? Use MYSQL_AUTOCONF=false
  • DNSSEC is disabled by default, to enable use MYSQL_DNSSEC=yes
  • Want to use own config files? Mount a Volume to /etc/pdns/conf.d or simply overwrite /etc/pdns/pdns.conf

PowerDNS Configuration:

Append the PowerDNS setting to the command as shown in the example above. See docker run --rm psitrax/powerdns --help

License

GNU General Public License v2.0 applyies to PowerDNS and all files in this repository.

Maintainer

Credits

docker-powerdns's People

Contributors

4n70w4 avatar asmaps avatar athalonis avatar bfysebman avatar kalabiyau avatar luto avatar lvrfrc87 avatar psi-4ward avatar r1co avatar rfrenayworldstream avatar rkmathi avatar steigr avatar tcely avatar unixfox avatar wmarbut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-powerdns's Issues

Is postgres really supported?

MySQL (default), Postgres, SQLite and Bind backend included

Apart from the README, I don't see any sign that Postgres is implemented.

DNSSEC not enabled

This is related to #18, but I have a different issue:

I haven't modified the pdns.conf (so it has #gmysql-dnssec=no in it, which is commented out). Then I pass the cli flag --gmysql-dnssec=yes to the container. The following output is ps afx from inside the container:

    1 root       0:00 {entrypoint.sh} /bin/sh /entrypoint.sh --dnsupdate=yes --allow-dnsupdate-from=192.168.0.0/16 10.96.0.0/12 10.1.0.0/24 --gmysql-dnssec=yes --log-dns-details=yes --log-dns-queries=yes --loglevel=6 --query-logging=yes
   21 root       0:00 pdns_server --dnsupdate=yes --allow-dnsupdate-from=192.168.0.0/16 10.96.0.0/12 10.1.0.0/24 --gmysql-dnssec=yes --log-dns-details=yes --log-dns-queries=yes --loglevel=6 --query-logging=yes
   23 pdns       0:00 pdns_server-instance --dnsupdate=yes --allow-dnsupdate-from=192.168.0.0/16 10.96.0.0/12 10.1.0.0/24 --gmysql-dnssec=yes --log-dns-details=yes --log-dns-queries=yes --loglevel=6 --query-logging=yes

From inside the container I'm using pdnsutil to enable DNSSEC for my zone which does not work:

/ # pdnsutil secure-zone example.com
Securing zone with default key size
Adding CSK (257) with algorithm ecdsa256
No backend was able to secure 'example.com', most likely because no DNSSEC
capable backends are loaded, or because the backends have DNSSEC disabled.
For the Generic SQL backends, set the 'gsqlite3-dnssec', 'gmysql-dnssec' or
'gpgsql-dnssec' flag. Also make sure the schema has been updated for DNSSEC!

Maybe the last sentence is a hint?

I also ran:

/ # pdnsutil rectify-zone example.com
Adding empty non-terminals for non-DNSSEC zone

Followed by another:

/ # pdnsutil secure-zone example.com
Securing zone with default key size
Adding CSK (257) with algorithm ecdsa256
No backend was able to secure 'example.com', most likely because no DNSSEC
capable backends are loaded, or because the backends have DNSSEC disabled.
For the Generic SQL backends, set the 'gsqlite3-dnssec', 'gmysql-dnssec' or
'gpgsql-dnssec' flag. Also make sure the schema has been updated for DNSSEC!

I'm using psitrax/powerdns:4.1.10.

What is the problem? Do you need more informations?

Thanks in advance!

Error when try add zone

Hello i have problem with add zone.

docker exec -it docker_pdns_1 pdnsutil --help

Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options19options_descriptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjj: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options13variables_mapC1Ev: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options30positional_options_description3addEPKci: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options6detail7cmdline22set_positional_optionsERKNS0_30positional_options_descriptionE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options6detail7cmdline27get_canonical_option_prefixEv: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options19options_description11add_optionsEv: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options29options_description_easy_initclEPKcPKNS0_14value_semanticES3_: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options5storeERKNS0_20basic_parsed_optionsIcEERNS0_13variables_mapEb: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options6detail7cmdlineC2ERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22abstract_variables_mapixERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options8validateERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EEPS9_i: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options6detail7cmdline23set_options_descriptionERKNS0_19options_descriptionE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options11to_internalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options6detail7cmdline3runEv: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options30positional_options_descriptionC1Ev: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_optionslsERSoRKNS0_19options_descriptionE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options29options_description_easy_initclEPKcS3_: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options29options_description_easy_initclEPKcPKNS0_14value_semanticE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options6notifyERNS0_13variables_mapE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options20invalid_option_valueC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name4whatEv: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name4whatEv: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name4whatEv: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name4whatEv: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name23substitute_placeholdersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name23substitute_placeholdersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name23substitute_placeholdersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options22error_with_option_name23substitute_placeholdersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZTIN5boost15program_options22error_with_option_nameE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZTIN5boost15program_options29value_semantic_codecvt_helperIcEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZTIN5boost15program_options29value_semantic_codecvt_helperIcEE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options29value_semantic_codecvt_helperIcE5parseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EEb: symbol not found
Error relocating /usr/bin/pdnsutil: _ZNK5boost15program_options29value_semantic_codecvt_helperIcE5parseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EEb: symbol not found
Error relocating /usr/bin/pdnsutil: _ZTVN5boost15program_options22error_with_option_nameE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options19options_description21m_default_line_lengthE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZTVN5boost15program_options13variables_mapE: symbol not found
Error relocating /usr/bin/pdnsutil: _ZN5boost15program_options3argB5cxx11E: symbol not found```

docker run pdns command error

i couldnt get this running so after some research found this command

docker run --name pdns \ --link pdns-mysql:mysql \ -p 53:53 \ -p 53:53/udp \ -e MYSQL_USER=root \ -e MYSQL_PASS=supersecret \ psitrax/powerdns \ --cache-ttl=120 \ --allow-axfr-ips=127.0.0.1 123.1.2.3

should be

docker run --name pdns \ --link pdns-mysql:mysql \ -p 53:53 \ -p 53:53/udp \ -e MYSQL_USER=root \ -e MYSQL_PASS=supersecret \ psitrax/powerdns \ --cache-ttl=120 \ --allow-axfr-ips=127.0.0.1,123.1.2.3

see --allow-axfr-ips their is a comma needed

Infinte "Waiting for database to come up" if running via docker swarm

version: "3.8"

services:
 pdns:
   image: psitrax/powerdns
   depends_on:
     - mariadb
   ports:
     - 53:53
     - 53:53/udp
   environment:
     - MYSQL_USER=root
     - MYSQL_PASS=supersecret
     - MYSQL_PORT=3306
     - MYSQL_HOST=mariadb
   command:
     - --cache-ttl=120
     - --allow-axfr-ips=127.0.0.1,123.1.2.3

 mariadb:
   image: mariadb:10.1
   environment:
     - MYSQL_ROOT_PASSWORD=supersecret

If I start docker-compose up - all ok.

pdns_1     | Sep 12 19:35:24 Guardian is launching an instance
pdns_1     | Sep 12 19:35:24 UDP server bound to 0.0.0.0:53
pdns_1     | Sep 12 19:35:24 TCP server bound to 0.0.0.0:53
pdns_1     | Sep 12 19:35:24 Master/slave communicator launching
pdns_1     | Sep 12 19:35:24 Creating backend connection for TCP
pdns_1     | Sep 12 19:35:24 Only asked for 1 backend thread - operating unthreaded

But via docker stack deploy --compose-file docker-compose.yml stackdemo errors:

ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up
 ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up
 ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up
 ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up
 ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up
 ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up
 ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up
 ERROR 1045 (28000): Access denied for user 'root'@'10.0.1.4' (using password: YES)
 Waiting for database to come up

Docker hub is missing tags for 4.5

Good morning,

Is it possible to include 4.5 and perhaps 4.6 on docker hub? The latest tag there is still on 4.4.1.

Thank you in advance.

Cheers,

Frank

docs required for "restart"

Sorry if this is a very naïve question, but I don't understand how to reload configuration. Docs say that a sysv script is provided do that it acceepts "start", "restart" (and more).
In the docker image which is the correct way to force powerdns to reload the configuration?

Tag for 4.5

Good morning,

Is the master branch ready to be tagged for 4.5?
I would love to use this.

Thank you in advance.

Cheers, Frank

Unable to redirect /etc/pdns/pdns.conf

I'm trying to redirect the whole pdns.conf file in psitrax/powerdns.

Here is my config:

docker create --name=pdns \
--user=root \
--log-driver syslog --log-opt tag=pdns_syslog --log-opt syslog-address=udp://10.0.0.5 \
--restart=always \
--network=infrastructure_network \
--network-alias=pdns \
-p 53:53 \
-p 53:53/udp \
-e PGID=1001 -e PUID=1001 \
-e TZ=America/Phoenix \
-v /local_configs/pdns/pdns.conf:/etc/pdns/pdns.conf \
psitrax/powerdns:latest \
--cache-ttl=120 \
--allow-axfr-ips=127.0.0.1,10.0.1.10

which results in the following errors:

sed: can't move '/etc/pdns/pdns.confbgdfep' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confglejgh' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.conficilgg' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confbfphgk' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.conflcbiha' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confamidpk' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confpnhbcn' to '/etc/pdns/pdns.conf': resource busy
sed: can't move '/etc/pdns/pdns.confcbenoh' to '/etc/pdns/pdns.conf': resource busy

I'm trying to follow your guide, which says "Want to use own config files? Mount a Volume to /etc/pdns/conf.d or simply overwrite /etc/pdns/pdns.conf" Am I missing a step??

Missing v4.3.0 on Docker Hub

Hey,
I tried to pull the latest version and it's not available on docker hub.

docker pull psitrax/powerdns:v4.3.0
Error response from daemon: manifest for psitrax/powerdns:v4.3.0 not found: manifest unknown: manifest unknown

Plugin caching_sha2_password could not be loaded

My error when connecting to mysql 8 database is:

Jun 24 03:00:37 gmysql Connection failed: Unable to connect to database: Plugin caching_sha2_password could not be loaded: Error loading shared library lib/mariadb/plugin/caching_sha2_password.so: No such file or directory

Jun 24 03:00:37 Caught an exception instantiating a backend: Unable to launch gmysql connection: Unable to connect to database: Plugin caching_sha2_password could not be loaded: Error loading shared library lib/mariadb/plugin/caching_sha2_password.so: No such file or directory

I peeked inside the container and discovered that it is not in the /lib, but in the /usr/lib directory there:

/usr/lib/mariadb/plugin
bash-4.4# ls -la 
total 72
drwxr-xr-x    2 root     root          4096 Jun 24 00:13 .
drwxr-xr-x    3 root     root          4096 Jun 24 00:13 ..
-rwxr-xr-x    1 root     root         14168 Jan 14  2019 caching_sha2_password.so
-rwxr-xr-x    1 root     root         14016 Jan 14  2019 dialog.so
-rwxr-xr-x    1 root     root         14016 Jan 14  2019 mysql_clear_password.so
-rwxr-xr-x    1 root     root         14168 Jan 14  2019 sha256_password.so

The error went away when i performed the following from the inside:


bash-4.4# cd /lib/
bash-4.4# ls
apk                    ld-musl-x86_64.so.1    libcrypto.so.1.1       libz.a                 libz.so.1              mdev
firmware               libc.musl-x86_64.so.1  libssl.so.1.1          libz.so                libz.so.1.2.11
bash-4.4# ls -la 
total 3868
drwxr-xr-x    1 root     root          4096 Jun 24 00:13 .
drwxr-xr-x    1 root     root          4096 Jun 24 03:00 ..
drwxr-xr-x    1 root     root          4096 Apr 23 13:10 apk
drwxr-xr-x    2 root     root          4096 Apr 23 13:10 firmware
-rwxr-xr-x    1 root     root        584304 Aug  7  2019 ld-musl-x86_64.so.1
lrwxrwxrwx    1 root     root            19 Apr 23 13:10 libc.musl-x86_64.so.1 -> ld-musl-x86_64.so.1
-rwxr-xr-x    1 root     root       2597536 Apr 21 17:27 libcrypto.so.1.1
-rwxr-xr-x    1 root     root        519632 Apr 21 17:27 libssl.so.1.1
-rw-r--r--    1 root     root        130106 Nov 15  2018 libz.a
lrwxrwxrwx    1 root     root            14 Jun 24 00:13 libz.so -> libz.so.1.2.11
lrwxrwxrwx    1 root     root            14 Apr 23 13:10 libz.so.1 -> libz.so.1.2.11
-rwxr-xr-x    1 root     root        100144 Nov 15  2018 libz.so.1.2.11
drwxr-xr-x    2 root     root          4096 Apr 23 13:10 mdev
bash-4.4# cp -R /usr/lib/mariadb .
bash-4.4# ls -la 
total 3872
drwxr-xr-x    1 root     root          4096 Jun 24 03:14 .
drwxr-xr-x    1 root     root          4096 Jun 24 03:00 ..
drwxr-xr-x    1 root     root          4096 Apr 23 13:10 apk
drwxr-xr-x    2 root     root          4096 Apr 23 13:10 firmware
-rwxr-xr-x    1 root     root        584304 Aug  7  2019 ld-musl-x86_64.so.1
lrwxrwxrwx    1 root     root            19 Apr 23 13:10 libc.musl-x86_64.so.1 -> ld-musl-x86_64.so.1
-rwxr-xr-x    1 root     root       2597536 Apr 21 17:27 libcrypto.so.1.1
-rwxr-xr-x    1 root     root        519632 Apr 21 17:27 libssl.so.1.1
-rw-r--r--    1 root     root        130106 Nov 15  2018 libz.a
lrwxrwxrwx    1 root     root            14 Jun 24 00:13 libz.so -> libz.so.1.2.11
lrwxrwxrwx    1 root     root            14 Apr 23 13:10 libz.so.1 -> libz.so.1.2.11
-rwxr-xr-x    1 root     root        100144 Nov 15  2018 libz.so.1.2.11
drwxr-xr-x    3 root     root          4096 Jun 24 03:14 mariadb
drwxr-xr-x    2 root     root          4096 Apr 23 13:10 mdev

The solution for now is to modify the docker file with :

RUN cp -R /usr/lib/mariadb /lib/.

API Key

Hello, could you add a way to provide an API Key and a port to use the API?

Use pdns from aports

If you don't have a reason to build this inside docker you could switch to the pdns package.

I recently updated it to 4.1.1 and added sub packages for tools and most of the available backends.

No transfers

I'm trying to use this with an existing powerdns-server as master.

From the slave I can do a dig AXFR @ the master and retrieve a correct zone file, but nothing ever enters into the database.

I've set slave=yes in the pdns.conf and added a record to supermasteres with the master IP address and slave nameserver name.

What am I missing?

I've setup nameservers, both bind and powerdns a few times before. By no means an expert, but not complete newb either.

DNS over TLS

hi, you project works like a charm! thank you!

how can i enable dns over tls? powerdns has this option but the documentation is sparse.

best

unknown parameter wilcard_url

Getting the following from the latest image when turning on the web server

Jan 19 04:11:02 Fatal error: Trying to set unknown parameter 'wildcard-url'

Probably should remove the parameter from the pdns.conf file in case someone unfamiliar with pdns ( like myself :) ) simply copies it.

Not the latest powerdns version

Hi I noticed that the powerdns currently is 4.4, but it haven't been updated yet. I would highly appreciate if you update it and in the dockerhub too

ARM64 image

Hi,

any plan to build a multiplatform image including ARM64 support?

Handle automatic DB upgrade

It would be nice if the container could automatically detect and trigger DB upgrade.

In order to achieve that, those are the steps I see:

  • Retrieve the SQL init and upgrade files from the PowerDNS archive (always up to date)
  • Save in a file the version of the database that was initialized (need to be persisted on host or in volume)
  • Execute update script if any found for current version to target version

Add Travis-CI / Dockerhub tests

It would be nice to have automated tests of PowerDNS, ideally using docker-compose to provide external database.

Might send a PR for this as well.

Enable dnssec?

The current container has dnssec disable in pdns.conf. For my needs it would be useful if it instead included gmysql-dnssec=yes but there might be a good reason to have it disabled that I'm not seeing?

unknown flag: --webserver See 'docker run --help'.

Hi, i keep getting error unknown flag when using: --webserver=yes
Can you please show example where the flag is used?
Thanks!

Here is what i'm trying:
docker run --name pdns
--webserver=yes
--link pdns-mysql:mysql
-p 53:53
-p 53:53/udp
-e MYSQL_USER=root
-e MYSQL_PASS=supersecret
psitrax/powerdns
--cache-ttl=120
--allow-axfr-ips=127.0.0.1,123.1.2.3

sed: bad option in substitution expression

receive this every time when running

docker run --name pdns \

--link pdns-mysql:mysql
-p 53:53
-p 53:53/udp
-e MYSQL_USER=root
-e MYSQL_PASS=supersecret
psitrax/powerdns
--cache-ttl=120
--allow-axfr-ips=127.0.0.1,123.1.2.3

Unable to start container

after start powerdns a few second container stop with these log

Initializing Database
Jun 12 07:58:12 Guardian is launching an instance
Fatal: non-option on the command line, perhaps a '--setting=123' statement missed the '='?

info:
database

docker run -d --name pdns-mysql \
-e MYSQL_ROOT_PASSWORD=pdns123 \
-v /opt/powerdns/mysql-data:/var/lib/mysql \
mariadb:10.1

powerdns

docker run -d --link pdns-mysql:mysql \
-p 53:53 \
-p 53:53/udp \
-e MYSQL_USER=root \
-e MYSQL_PASS=pdns123 \
--restart=always \
--name pdns psitrax/powerdns \
--cache-ttl=120 \
--allow-axfr-ips=127.0.0.1 192.2.200.240

Error mounting /etc/pdns/pdns.conf

cat run.sh
#!/usr/bin/env bash


docker run --name pdns \
  --link pdns-mysql:mysql \
  -p 53:53 \
  -p 53:53/udp \
  -e MYSQL_USER=root \
  -e MYSQL_PASS=supersecret \
  -v /home/vagrant/pdns.conf:/etc/pdns/pdns.conf \
  psitrax/powerdns \
    --cache-ttl=120 \
    --allow-axfr-ips=127.0.0.1,123.1.2.3


vagrant@powerdns:~$ sudo /vagrant/provisioning/powerdns/run.sh
Unable to find image 'psitrax/powerdns:latest' locally
latest: Pulling from psitrax/powerdns
c67f3896b22c: Already exists
f69a06678376: Pull complete
a2e0e5d77486: Pull complete
b2afe8f546bf: Pull complete
Digest: sha256:a758775b260d31673f76c2a7747a12f15564afafa74e10d9ae023ac4eb3ad49c
Status: Downloaded newer image for psitrax/powerdns:latest
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/home/vagrant/pdns.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/8571904bcf0ddcc9cdac0cd5966ef8ada813f9d7f94446f3a897f847e400053b/merged\\\" at \\\"/var/lib/docker/overlay2/8571904bcf0ddcc9cdac0cd5966ef8ada813f9d7f94446f3a897f847e400053b/merged/etc/pdns/pdns.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

Custom SQL hook

Can you add a custom SQL "initialization" hook into entrypoint.sh?

Background:
Currently when starting entrypoint.sh will execute schema.sql and then immediately start pdns.
In my use case I need to add some entries into the supermasters table between DB initialization and service start.

So far my options are to replace either entrypoint.sh or schema.sql in my own Dockerfile. As soon as I do that and you update your Image I would then risk overwriting an improved file with a file based on an older version.

Can you include something like this in your script?

if [ -f "/etc/pdns/post-schema.sql" ]; then
  cat /etc/pdns/post-schema.sql | $MYSQLCMD
fi

... immediately after "sending" schema.sql to MySQL?

I would then be able to just add a post-schema.sql that would be triggered on database init.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.