From 34f3747a3bdb383fa6c7e8780a67fe46543a91a8 Mon Sep 17 00:00:00 2001 From: nemunaire Date: Tue, 13 Jan 2015 18:08:22 +0100 Subject: [PATCH] Dockerfile for PKI --- README.md | 27 +++++++++++++++++++++++++++ pki/Dockerfile | 25 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 pki/Dockerfile diff --git a/README.md b/README.md index a28a9c7d..03233e11 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,33 @@ docker rm db_setup docker run -d --name db --volumes-from mysql_data mysql ``` +4. Setup the PKI storages: + +``` +docker run --name pki_storage -v /var/www/fic-server/PKI busybox +docker run --name shared_storage -v /var/www/fic-server/shared busybox +``` + +5. Build the PKI configuration container: + +``` +docker build -t pki_setup pki/ +``` + +6. Configure the PKI + +For development purpose, you can run the default setup: + +``` +docker run --rm -it --volumes-from pki_storage --volumes-from shared_storage pki_setup +``` + +For production environment: + +``` +docker run --rm -it --volumes-from pki_storage --volumes-from shared_storage pki_setup /bin/bash +TODO next steps +``` ##### Requirements diff --git a/pki/Dockerfile b/pki/Dockerfile new file mode 100644 index 00000000..da5694a5 --- /dev/null +++ b/pki/Dockerfile @@ -0,0 +1,25 @@ +FROM debian:wheezy +MAINTAINER Pierre-Olivier Mercier + +# Install packages #################################################### + +RUN apt-get -y update && \ + apt-get install -y \ + pwgen \ + openssl \ + && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Copying files ####################################################### + +ADD CA.sh openssl.cnf /var/www/fic-server/pki/ + +# ENVIRONNEMENT ####################################################### + +VOLUME ["/var/www/fic-server/PKI"] + +WORKDIR /var/www/fic-server/pki + +CMD bash ./CA.sh -newca && \ + bash ./CA.sh -newserver && \ + bash ./CA.sh -gencrl