We can run a PuppetDB server in a docker container.
Inorder to run a PuppetDB, we need a Postgres Server running. Docker supports only PostgreSQL server.
This too can be another container instance, or RDS (Relational Database Service) end point or a Physical DB somewhere.
In addition, It requires a Puppet Master running. In order to use SSL certs during the initialization, you will need at least a token puppet master running that the container can connect to initialize the certs.
root@ubuntu:~# git clone https://github.com/tizzo/docker-puppetdb.git
Cloning into 'docker-puppetdb'...
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 12 (delta 3), reused 12 (delta 3), pack-reused 0
Unpacking objects: 100% (12/12), done.
Checking connectivity... done.
root@ubuntu:~# cd docker-puppetdb/
Create a Docker file compatible with Ubuntu 16.04 and then run the docker build.
root@ubuntu:~/docker-puppetdb# docker build .
Once this is completed we can create our PuppetDB container.
root@ubuntu:~# docker run --net puppet --name puppetdb-postgres -e POSTGRES_PASSWORD=puppetdb -e POSTGRES_USER=puppetdb -d postgres
855a6b13fefa4123d5e16cdde84ebc7174ba149e66699e4c94c14e8fbfcac22f
root@ubuntu:~# docker run --net puppet -d -P --name puppetdb --link puppetdb-postgres:postgres puppet/puppetdb
bfe56b64bd980d20570374ed8204136303d82de8cbf1a4279c2f2fd25a798f59
Container is running, we can even confirm its status by with this command, docker ps.
We can access our PuppetDB Dashboard at the URL >>http://Docker-Server-IP:32771.