Containerize TPM Initialization tool
[aaf/sshsm.git] / bin / abrmdcontainer / dockerfile
1 FROM ubuntu:xenial
2
3 RUN apt-get -y update && \
4   apt-get -y install \
5     autoconf \
6     autoconf-archive \
7     libglib2.0-dev \
8     libdbus-1-dev \
9     automake \
10     libtool \
11     autotools-dev \
12     libcppunit-dev \
13     p11-kit \
14     libcurl4-gnutls-dev \
15     libcmocka0 \
16     libcmocka-dev \
17     build-essential \
18     git \
19     pkg-config \
20     gcc \
21     g++ \
22     m4 \
23     wget \
24     liburiparser-dev \
25     libssl-dev \
26     pandoc
27
28 RUN apt-get -y install libgcrypt20-dev
29
30 RUN git clone https://github.com/tpm2-software/tpm2-tss.git
31 RUN git clone https://github.com/tpm2-software/tpm2-abrmd.git
32 RUN git clone https://github.com/tpm2-software/tpm2-tools.git
33
34 # Directory for the scripts
35 RUN mkdir -p /abrmd/bin
36
37 RUN cd tpm2-tss && \
38   git checkout 1.2.0 && \
39   ./bootstrap && \
40   ./configure && \
41   make && \
42   make install
43
44 RUN cd tpm2-abrmd && \
45   git checkout 1.1.1 && \
46   useradd --system --user-group tss && \
47   ./bootstrap && \
48   ./configure --with-dbuspolicydir=/etc/dbus-1/system.d \
49     --with-udevrulesdir=/etc/udev/rules.d/ \
50     --with-systemdsystemunitdir=/lib/systemd/system && \
51   make && \
52   make install
53
54 RUN cd tpm2-tools && \
55   git checkout 2.1.0 && \
56   ./bootstrap && \
57   ./configure --with-tcti-tabrmd=yes && \
58   make && \
59   make install
60
61 RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/tpm2.conf && \
62   ldconfig
63
64 RUN rm -rf tpm2-tss
65 RUN rm -rf tpm2-abrmd
66 RUN rm -rf tpm2-tools
67
68 COPY ./initialize_tpm.sh /abrmd/bin/
69 COPY ./run_abrmd.sh /abrmd/bin/
70 COPY ./init.sh /abrmd/bin/
71
72 RUN chmod -R +x /abrmd/bin