forked from tpm2-software/tpm2-software-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfedora-30.docker
101 lines (92 loc) · 2.76 KB
/
fedora-30.docker
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
FROM fedora:30
# can return 100 if packages need update
RUN yum check-update; \
rc=$?; \
if [ $rc -ne 100 ] && [ $rc -ne 0 ]; then \
echo "yum check-update failed: $rc"; \
exit $rc; \
fi
RUN yum -y install \
libcmocka \
libcmocka-devel \
net-tools \
git \
pkg-config \
gcc \
m4 \
libtool \
automake \
libgcrypt-devel \
openssl-devel \
gnulib \
glib2-devel \
wget \
doxygen \
dbus-libs \
dbus-devel \
clang \
clang-analyzer \
clang-tools-extra \
pandoc \
lcov \
libcurl-devel \
dbus-x11 \
python3-pyyaml \
vim \
python3-pip \
libsq3-devel \
python3-cryptography \
iproute \
procps \
libasan \
libubsan \
perl-Digest-SHA \
libtasn1-devel \
socat \
libseccomp-devel \
expect \
gawk
ARG autoconf_archive=autoconf-archive-2018.03.13
WORKDIR /tmp
RUN wget --quiet --show-progress --progress=dot:giga "http://mirror.kumi.systems/gnu/autoconf-archive/$autoconf_archive.tar.xz" \
&& tar -xf $autoconf_archive.tar.xz \
&& rm $autoconf_archive.tar.xz \
&& cd $autoconf_archive \
&& ./configure --prefix=/usr \
&& make -j $(nproc) && make install
RUN rm -fr $autoconf_archive.tar.xz
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 rm -fr $ibmtpm_name/src $ibmtpm_name.tar.gz
WORKDIR /tmp
RUN git clone https://github.com/stefanberger/libtpms.git
RUN cd libtpms \
&& ./autogen.sh --prefix=/usr --with-openssl --with-tpm2 \
&& make -j$(nproc) \
&& make install
WORKDIR /tmp
RUN git clone https://github.com/stefanberger/swtpm.git
RUN cd swtpm \
&& ./autogen.sh --prefix=/usr \
&& make -j$(nproc) \
&& make install
ARG uthash="2.1.0"
WORKDIR /tmp
RUN wget --quiet --show-progress --progress=dot:giga "https://github.com/troydhanson/uthash/archive/v${uthash}.tar.gz" \
&& tar -xf v${uthash}.tar.gz \
&& cp uthash-${uthash}/src/*.h /usr/include/
RUN rm -rf uthash-${uthash}/ v${uthash}.tar.gz
# make install goes into /usr/local/lib/pkgconfig which is non-standard
# Set this so ./configure can find things and we don't have to worry about prefix changes
# to build instructions
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# we need/check for just python, Fedora comes with python3 so just symlink it
RUN ln -s /usr/bin/python3 /usr/bin/python