Skip to content

Commit

Permalink
updating dockerfile and csr_details
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoch committed Jul 29, 2017
1 parent 3ec65d9 commit c660e2d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
36 changes: 12 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,22 @@ RUN git clone https://github.com/vsoch/pydicom
WORKDIR pydicom
RUN python setup.py install

RUN mkdir /code
RUN mkdir -p /var/www/images
RUN mkdir /data
WORKDIR /code
RUN /usr/bin/yes | pip uninstall cython
RUN apt-get remove -y gfortran

# This is needed for certificate on server, interactive run for now
# http://www.zoharbabin.com/install-ssl-on-ubuntu-and-enable-https/
WORKDIR /tmp
RUN openssl genrsa -out server.key 4096 && mv server.key /etc/ssl/certs
RUN openssl dhparam -out dhparam.pem 4096 && mv dhparam.pem /etc/ssl/certs
RUN cat > csr_details.txt <<-EOF
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn

[ dn ]
C=US
ST=California
L=San Mateo County
O=End Point
OU=Sendit
[email protected]
CN = cci-docker-webapp-p03
EOF

RUN cp /code/csr_details.txt /tmp
WORKDIR /tmp
RUN echo CN = \"`hostname`\" >> csr_details.txt

# call openssl now by piping the newly created file in
RUN openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config <( cat csr_details.txt )
Expand All @@ -98,18 +93,11 @@ RUN cp server.key /etc/ssl/private
RUN cp server.crt /etc/ssl/certs

# Reinstall root certificates
RUN apt-get install --reinstall ca-certificates
RUN apt-get install -y ca-certificates
RUN mkdir /usr/local/share/ca-certificates/cacert.org
RUN wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt
RUN update-ca-certificates

RUN mkdir /code
RUN mkdir -p /var/www/images
RUN mkdir /data
WORKDIR /code
RUN /usr/bin/yes | pip uninstall cython
RUN apt-get remove -y gfortran

RUN apt-get autoremove -y
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
12 changes: 12 additions & 0 deletions csr_details.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn

[ dn ]
C=US
ST=California
L=San Mateo County
O=End Point
OU=Sendit

0 comments on commit c660e2d

Please sign in to comment.