-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
39 lines (32 loc) · 1.54 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
FROM debian:wheezy
ADD pkcs11-proxy.diff /pkcs11-proxy.diff
# Build pkcs11-proxy
RUN apt-get -y update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get -y install git dpkg-dev cmake cdbs debhelper libssl-dev \
&& git config --global user.email "[email protected]" && git config --global user.name "Robert Quattlebaum" \
&& git clone https://github.com/SUNET/pkcs11-proxy.git \
&& cd pkcs11-proxy \
&& git checkout 0caa567d78a6d88365946399b68e3327969f3bff \
&& git cherry-pick 1c2954cde94a5d4ac87528bd90c29c6a24374f60 ae700e6e5201d5288c82c9834a708bc09e488afa \
&& git apply ../pkcs11-proxy.diff \
&& DEBIAN_FRONTEND=noninteractive dpkg-buildpackage \
&& cd / \
&& DEBIAN_FRONTEND=noninteractive dpkg -i pkcs11-daemon_0.4-1ubuntu3_amd64.deb pkcs11-proxy1_0.4-1ubuntu3_amd64.deb \
&& DEBIAN_FRONTEND=noninteractive apt-get -y purge git dpkg-dev cmake cdbs debhelper libssl-dev \
&& DEBIAN_FRONTEND=noninteractive apt-get -y autoremove \
&& DEBIAN_FRONTEND=noninteractive apt-get -y clean \
&& rm -fr pkcs11* \
&& mkdir /usr/lib/pkcs11-proxy \
&& cp /usr/lib/libpkcs11-proxy.* /usr/lib/pkcs11-proxy/ \
&& true
# Install softhsm
RUN apt-get -y update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get -y install softhsm
# Initially configure the token
RUN echo 0:/var/lib/softhsm/slot0.db > /etc/softhsm/softhsm.conf && softhsm --init-token --pin 123456 --so-pin 12345678 --slot 0 --label SoftHSMToken
EXPOSE 54435
ENV PKCS11_DAEMON_SOCKET="tcp://0.0.0.0:54435"
VOLUME ["/usr/lib/pkcs11-proxy"]
CMD ["/usr/bin/pkcs11-daemon", "/usr/lib/softhsm/libsofthsm.so"]