You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by di...@apache.org on 2020/04/21 23:21:57 UTC

[incubator-teaclave-sgx-sdk] 02/02: Add Ubuntu 20.04 dockerfile

This is an automated email from the ASF dual-hosted git repository.

dingyu pushed a commit to branch v1.1.2-testing
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git

commit a740c3a40dcdcd8282f75ddc7cfc2ab9ae26f0c4
Author: Yu Ding <di...@gmail.com>
AuthorDate: Tue Apr 21 16:21:39 2020 -0700

    Add Ubuntu 20.04 dockerfile
---
 dockerfile/03_sdk_gcc9.sh          | 11 +++++++++++
 dockerfile/04_psw_deb.sh           | 11 +++++++++++
 dockerfile/Dockerfile.2004.nightly | 40 ++++++++++++++++++++++++++++++++++++++
 dockerfile/focal_psw_patch         | 16 +++++++++++++++
 dockerfile/gcc9_patch              | 12 ++++++++++++
 5 files changed, 90 insertions(+)

diff --git a/dockerfile/03_sdk_gcc9.sh b/dockerfile/03_sdk_gcc9.sh
new file mode 100644
index 0000000..a3a7258
--- /dev/null
+++ b/dockerfile/03_sdk_gcc9.sh
@@ -0,0 +1,11 @@
+cd /root && \
+git clone --recursive https://github.com/intel/linux-sgx && \
+cd linux-sgx && \
+git checkout sgx_2.9.1 && \
+./download_prebuilt.sh && \
+git apply /root/gcc9_patch && \
+make -j "$(nproc)" sdk_install_pkg && \
+echo -e 'no\n/opt' | ./linux/installer/bin/sgx_linux_x64_sdk_2.9.101.2.bin && \
+echo 'source /opt/sgxsdk/environment' >> /root/.bashrc && \
+cd /root && \
+rm -rf /root/linux-sgx
diff --git a/dockerfile/04_psw_deb.sh b/dockerfile/04_psw_deb.sh
new file mode 100644
index 0000000..a679dd9
--- /dev/null
+++ b/dockerfile/04_psw_deb.sh
@@ -0,0 +1,11 @@
+source /opt/sgxsdk/environment && \
+cd /root && \
+git clone --recursive https://github.com/intel/linux-sgx && \
+cd linux-sgx && \
+git checkout sgx_2.9.1 && \
+git apply /root/focal_psw_patch && \
+./download_prebuilt.sh && \
+make deb_local_repo && \
+cd linux/installer/deb && \
+find . -maxdepth 2 -name '*.deb' | grep -v pccs | xargs dpkg -i
+#cd /root && \ rm -rf /root/linux-sgx
diff --git a/dockerfile/Dockerfile.2004.nightly b/dockerfile/Dockerfile.2004.nightly
new file mode 100644
index 0000000..bd5c435
--- /dev/null
+++ b/dockerfile/Dockerfile.2004.nightly
@@ -0,0 +1,40 @@
+FROM ubuntu:20.04
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt update && apt install -y lsb-release debhelper cmake reprepro autoconf automake bison build-essential curl dpkg-dev expect flex gcc-8 gdb git git-core gnupg kmod libboost-system-dev libboost-thread-dev libcurl4-openssl-dev libiptcdata0-dev libjsoncpp-dev liblog4cpp5-dev libprotobuf-dev libssl-dev libtool libxml2-dev ocaml ocamlbuild pkg-config protobuf-compiler python sudo systemd-sysv texinfo uuid-dev vim wget && \
+    rm -rf /var/lib/apt/lists/*
+
+#20.04 does have gcc-9
+#ADD 01_gcc_8.sh /root
+#RUN bash /root/01_gcc_8.sh
+
+ENV BINUTILS_PREFIX=/usr
+
+ADD 02_binutils.sh /root
+RUN bash /root/02_binutils.sh
+
+ADD 03_sdk_gcc9.sh /root
+ADD gcc9_patch /root
+RUN bash /root/03_sdk_gcc9.sh
+    
+# Sixth, PSW
+
+ENV CODENAME        bionic
+ENV VERSION         2.9.101.2-bionic1
+
+ADD 04_psw_deb.sh /root
+ADD focal_psw_patch /root
+RUN bash /root/04_psw_deb.sh
+
+# Seventh, Rust
+
+ENV rust_toolchain  nightly-2020-04-07
+ADD 05_rust.sh /root
+RUN bash /root/05_rust.sh
+
+ENV DEBIAN_FRONTEND=
+ENV CODENAME=
+ENV VERSION=
+
+WORKDIR /root
diff --git a/dockerfile/focal_psw_patch b/dockerfile/focal_psw_patch
new file mode 100644
index 0000000..2bd5b4e
--- /dev/null
+++ b/dockerfile/focal_psw_patch
@@ -0,0 +1,16 @@
+diff --git a/linux/installer/deb/local_repo_tool/conf/distributions b/linux/installer/deb/local_repo_tool/conf/distributions
+index 2d76202f..47ccac49 100644
+--- a/linux/installer/deb/local_repo_tool/conf/distributions
++++ b/linux/installer/deb/local_repo_tool/conf/distributions
+@@ -13,3 +13,11 @@ Architectures: amd64
+ Components: main
+ Description: ubuntu/bionic repository for SGX PSW
+ DebIndices: Packages .
++
++Origin: Intel Corporation
++Label: Intel Corporation
++Codename: focal
++Architectures: amd64
++Components: main
++Description: ubuntu/focal repository for SGX PSW
++DebIndices: Packages .
diff --git a/dockerfile/gcc9_patch b/dockerfile/gcc9_patch
new file mode 100644
index 0000000..e01ab62
--- /dev/null
+++ b/dockerfile/gcc9_patch
@@ -0,0 +1,12 @@
+diff --git a/buildenv.mk b/buildenv.mk
+index 767bfc4f..ec945826 100644
+--- a/buildenv.mk
++++ b/buildenv.mk
+@@ -212,6 +212,7 @@ endif
+ endif
+
+ MITIGATION_CFLAGS += $(MITIGATION_ASFLAGS)
++MITIGATION_CFLAGS += -fcf-protection=none
+
+ # Compiler and linker options for an Enclave
+ #


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org