-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
46 lines (34 loc) · 1.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM ubuntu:18.04
# --->
# ---> Install openssl for creating the on-premises Root CA and
# ---> also install the AWS Cli for accessing AWS's Cert Manager
# ---> API to create and use the subordinate cloud-centric CA.
# --->
USER root
RUN apt-get update && apt-get --assume-yes upgrade && apt-get --assume-yes install -qq -o=Dpkg::Use-Pty=0 \
python3-pip \
jq \
groff \
openssl
RUN pip3 install --upgrade awscli && pip3 --version && aws --version
# --->
# ---> Create 2 directories where the first contains the script
# ---> and other scaffolding artifacts and the second contains
# ---> the key and certificate artifacts.
# --->
RUN mkdir -p /root/cert.authority /root/cert.directory
RUN chmod 700 /root/cert.directory
WORKDIR /root/cert.authority
# --->
# ---> Install the key artifacts from the docker context
# ---> into the staging folder /root/cert.authority
# --->
COPY cert-authority-manager.sh .
COPY openssl-directives.cnf .
COPY subordinate-ca-template.json .
RUN chmod u+x cert-authority-manager.sh
RUN touch index.txt && echo 1000 > serial
# --->
# ---> docker run invokes the cert authority manager
# --->
ENTRYPOINT ["/root/cert.authority/cert-authority-manager.sh"]