Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 1 | FROM ubuntu:18.04 |
Julien Hachenberger | ccdf669 | 2018-10-23 16:49:04 +0200 | [diff] [blame] | 2 | RUN apt-get update && apt-get install -y \ |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 3 | autoconf \ |
John Andersen | 6c601f0 | 2017-06-29 15:23:27 -0700 | [diff] [blame] | 4 | autoconf-archive \ |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 5 | automake \ |
John Andersen | 6c601f0 | 2017-06-29 15:23:27 -0700 | [diff] [blame] | 6 | build-essential \ |
Julien Hachenberger | ef68d65 | 2018-11-23 08:58:45 +0100 | [diff] [blame] | 7 | doxygen \ |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 8 | gcc \ |
John Andersen | 6c601f0 | 2017-06-29 15:23:27 -0700 | [diff] [blame] | 9 | git \ |
Julien Hachenberger | b8cbdb5 | 2018-11-22 14:31:33 +0100 | [diff] [blame] | 10 | gnulib \ |
John Andersen | 6c601f0 | 2017-06-29 15:23:27 -0700 | [diff] [blame] | 11 | libssl-dev \ |
John Andersen | 6c601f0 | 2017-06-29 15:23:27 -0700 | [diff] [blame] | 12 | libtool \ |
Bastian | df94457 | 2018-11-13 17:36:16 +0100 | [diff] [blame] | 13 | pkg-config \ |
| 14 | wget |
John Andersen | 6c601f0 | 2017-06-29 15:23:27 -0700 | [diff] [blame] | 15 | |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 16 | # OpenSSL |
| 17 | ARG openssl_name=openssl-1.1.0h |
| 18 | WORKDIR /tmp |
Julien Hachenberger | dc0a867 | 2018-10-23 17:03:57 +0200 | [diff] [blame] | 19 | RUN wget --quiet --show-progress --progress=dot:giga https://www.openssl.org/source/$openssl_name.tar.gz \ |
| 20 | && tar xvf $openssl_name.tar.gz \ |
| 21 | && rm /tmp/$openssl_name.tar.gz |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 22 | WORKDIR $openssl_name |
Julien Hachenberger | 300b7d6 | 2018-10-23 17:13:35 +0200 | [diff] [blame] | 23 | RUN ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl \ |
| 24 | && make -j$(nproc) \ |
| 25 | && make install \ |
| 26 | && openssl version |
John Andersen | 6c601f0 | 2017-06-29 15:23:27 -0700 | [diff] [blame] | 27 | |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 28 | # IBM's Software TPM 2.0 |
| 29 | ARG ibmtpm_name=ibmtpm1119 |
| 30 | WORKDIR /tmp |
Julien Hachenberger | dc0a867 | 2018-10-23 17:03:57 +0200 | [diff] [blame] | 31 | RUN wget --quiet --show-progress --progress=dot:giga "https://downloads.sourceforge.net/project/ibmswtpm2/$ibmtpm_name.tar.gz" \ |
| 32 | && sha256sum $ibmtpm_name.tar.gz | grep ^b9eef79904e276aeaed2a6b9e4021442ef4d7dfae4adde2473bef1a6a4cd10fb \ |
| 33 | && mkdir -p $ibmtpm_name \ |
| 34 | && tar xvf $ibmtpm_name.tar.gz -C $ibmtpm_name \ |
| 35 | && rm $ibmtpm_name.tar.gz |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 36 | WORKDIR $ibmtpm_name/src |
Julien Hachenberger | 300b7d6 | 2018-10-23 17:13:35 +0200 | [diff] [blame] | 37 | RUN CFLAGS="-I/usr/local/openssl/include" make -j$(nproc) \ |
| 38 | && cp tpm_server /usr/local/bin |
John Andersen | 80efcb4 | 2017-07-18 15:01:51 -0700 | [diff] [blame] | 39 | |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 40 | RUN apt-get install -y \ |
Jonas Witschel | 1ca31c7 | 2019-01-13 11:42:03 +0100 | [diff] [blame^] | 41 | iproute2 \ |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 42 | libcmocka0 \ |
| 43 | libcmocka-dev \ |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 44 | uthash-dev |
John Andersen | e459189 | 2017-07-19 10:13:30 -0700 | [diff] [blame] | 45 | |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 46 | # TPM2-TSS |
| 47 | COPY . /tmp/tpm2-tss/ |
| 48 | WORKDIR /tmp/tpm2-tss |
Julien Hachenberger | b8cbdb5 | 2018-11-22 14:31:33 +0100 | [diff] [blame] | 49 | RUN ./bootstrap -I /usr/share/gnulib/m4 \ |
Julien Hachenberger | 300b7d6 | 2018-10-23 17:13:35 +0200 | [diff] [blame] | 50 | && ./configure --enable-unit \ |
| 51 | && make -j$(nproc) check \ |
| 52 | && make install \ |
| 53 | && ldconfig |
Tony Y | 14a2400 | 2018-06-05 14:00:41 -0700 | [diff] [blame] | 54 | ENV LD_LIBRARY_PATH /usr/local/lib |
| 55 | RUN cat test-suite.log |
| 56 | |