浏览代码

Begin dockerization

Ian Goldberg 11 月之前
父节点
当前提交
e285d1490d
共有 2 个文件被更改,包括 36 次插入0 次删除
  1. 30 0
      docker/Dockerfile
  2. 6 0
      docker/start-aesmd

+ 30 - 0
docker/Dockerfile

@@ -0,0 +1,30 @@
+FROM ubuntu:22.04 AS sgx
+RUN apt update && apt install -y build-essential ocaml ocamlbuild \
+    automake autoconf libtool wget python-is-python3 libssl-dev \
+    git cmake perl unzip debhelper libcurl4-openssl-dev \
+    protobuf-compiler reprepro
+WORKDIR /root
+RUN git clone https://github.com/intel/linux-sgx
+WORKDIR /root/linux-sgx
+RUN git checkout sgx_2.22
+RUN make preparation
+RUN make sdk_install_pkg
+RUN cd linux/installer/bin/ && echo -e "no\n/opt/intel" | ./sgx_linux_x64_sdk_2.22*
+RUN make psw_install_pkg
+RUN cd linux/installer/bin/ && ./sgx_linux_x64_psw_2.22* --no-start-aesm
+WORKDIR /root
+RUN git clone https://github.com/intel/intel-sgx-ssl
+WORKDIR /root/intel-sgx-ssl/openssl_source
+RUN wget https://www.openssl.org/source/openssl-3.0.12.tar.gz
+WORKDIR /root/intel-sgx-ssl/Linux
+RUN make
+RUN make install
+WORKDIR /root
+RUN addgroup sgx
+RUN addgroup sgx_prv
+RUN adduser aesmd sgx
+RUN adduser aesmd sgx_prv
+COPY start-aesmd /usr/local/sbin
+RUN chown aesmd.aesmd /var/run/aesmd
+RUN chmod 755 /usr/local/sbin/start-aesmd
+ENTRYPOINT ["/usr/local/sbin/start-aesmd"]

+ 6 - 0
docker/start-aesmd

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+chgrp sgx /dev/sgx_enclave
+chgrp sgx_prv /dev/sgx_provision
+su -s /bin/bash aesmd -c "LD_LIBRARY_PATH=/opt/intel/sgxpsw/aesm /opt/intel/sgxpsw/aesm/aesm_service" 2>/dev/null
+exec /bin/bash -c $*