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