forked from tpm2-software/tpm2-tss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (54 loc) · 1.49 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
47
48
49
50
51
52
53
54
55
56
57
58
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y \
autoconf \
autoconf-archive \
automake \
build-essential \
g++ \
gcc \
git \
libssl-dev \
libtool \
m4 \
net-tools \
pkg-config \
wget
# OpenSSL
ARG openssl_name=openssl-1.1.0h
WORKDIR /tmp
RUN wget --quiet --show-progress --progress=dot:giga https://www.openssl.org/source/$openssl_name.tar.gz \
&& tar xvf $openssl_name.tar.gz \
&& rm /tmp/$openssl_name.tar.gz
WORKDIR $openssl_name
RUN ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl \
&& make -j$(nproc) \
&& make install \
&& openssl version
# IBM's Software TPM 2.0
ARG ibmtpm_name=ibmtpm1119
WORKDIR /tmp
RUN wget --quiet --show-progress --progress=dot:giga "https://downloads.sourceforge.net/project/ibmswtpm2/$ibmtpm_name.tar.gz" \
&& sha256sum $ibmtpm_name.tar.gz | grep ^b9eef79904e276aeaed2a6b9e4021442ef4d7dfae4adde2473bef1a6a4cd10fb \
&& mkdir -p $ibmtpm_name \
&& tar xvf $ibmtpm_name.tar.gz -C $ibmtpm_name \
&& rm $ibmtpm_name.tar.gz
WORKDIR $ibmtpm_name/src
RUN CFLAGS="-I/usr/local/openssl/include" make -j$(nproc) \
&& cp tpm_server /usr/local/bin
RUN apt-get install -y \
libcmocka0 \
libcmocka-dev \
libgcrypt20-dev \
libtool \
liburiparser-dev \
uthash-dev
# TPM2-TSS
COPY . /tmp/tpm2-tss/
WORKDIR /tmp/tpm2-tss
RUN ./bootstrap \
&& ./configure --enable-unit \
&& make -j$(nproc) check \
&& make install \
&& ldconfig
ENV LD_LIBRARY_PATH /usr/local/lib
RUN cat test-suite.log