Setting up your own Docker server

Set up a machine running Ubuntu server (or likewise).

Install Docker by the following command:

sudo apt-get install docker.io
You can also install the latest version of Docker instead of the one bundeled with Ubuntu liked described here.

For security we need to generate some certificates that PeakFlow is going to use to connect to your server.

openssl genrsa -out ca-key.pem 4096
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem
openssl genrsa -out server-key.pem 4096
openssl req -subj "/CN=MY-HOST" -sha256 -new -key server-key.pem -out server.csr
openssl x509 -req -days 3650 -sha256 -in server.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem

Go to your account and create a Docker server. Use the content of the certificate files.

Client certificate content server-cert.pem
Client key content server-key.pem
SSL CA content ca.srl

Edit the file located here: /lib/systemd/system/docker.service

Edit the line that starts with "ExecStart=" to look something like this:

ExecStart=/usr/bin/dockerd -H fd:// --tlsverify --tlscacert=/path/to/PeakFlowCertificates/ca.pem --tlscert=/path/to/PeakFlowCertificates/server-cert.pem --tlskey=/path/to/PeakFlowCertificates/server-key.pem -H tcp://0.0.0.0:2376

Then run the following commands:

sudo systemctl daemon-reload
sudo service docker restart

All done! Your server should now be used to run builds for your account.