Dockerfile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. FROM ubuntu:22.04 AS sgx
  2. RUN apt update && apt install -y build-essential ocaml ocamlbuild \
  3. automake autoconf libtool wget python-is-python3 libssl-dev \
  4. git cmake perl unzip debhelper libcurl4-openssl-dev \
  5. protobuf-compiler reprepro
  6. WORKDIR /root
  7. RUN git clone https://github.com/intel/linux-sgx
  8. WORKDIR /root/linux-sgx
  9. RUN git checkout sgx_2.22
  10. RUN make preparation
  11. RUN make sdk_install_pkg
  12. RUN cd linux/installer/bin/ && echo -e "no\n/opt/intel" | ./sgx_linux_x64_sdk_2.22*
  13. RUN make psw_install_pkg
  14. RUN cd linux/installer/bin/ && ./sgx_linux_x64_psw_2.22* --no-start-aesm
  15. WORKDIR /root
  16. RUN git clone https://github.com/intel/intel-sgx-ssl
  17. WORKDIR /root/intel-sgx-ssl
  18. RUN git checkout 5304f692
  19. WORKDIR /root/intel-sgx-ssl/openssl_source
  20. RUN wget https://www.openssl.org/source/openssl-3.0.12.tar.gz
  21. WORKDIR /root/intel-sgx-ssl/Linux
  22. RUN make
  23. RUN make install
  24. WORKDIR /root
  25. RUN addgroup sgx
  26. RUN addgroup sgx_prv
  27. RUN adduser aesmd sgx
  28. RUN adduser aesmd sgx_prv
  29. COPY docker/start-aesmd /usr/local/sbin
  30. RUN chown aesmd.aesmd /var/run/aesmd
  31. RUN chmod 755 /usr/local/sbin/start-aesmd
  32. ENTRYPOINT ["/usr/local/sbin/start-aesmd"]
  33. # Remove the SGX SDK sources from the image
  34. FROM sgx AS sgx_no_source
  35. WORKDIR /root
  36. RUN rm -rf linux-sgx intel-sgx-ssl
  37. FROM scratch
  38. # Copy the sgx_no_source filesystem; this loses the history, but the
  39. # history contained the multi-GB SGX SDK sources that we have since
  40. # removed, so that's actually what we want.
  41. COPY --from=sgx_no_source / /
  42. RUN apt update && apt install -y libboost-dev libboost-thread-dev \
  43. numactl python3-numpy python3-yaml cpuid
  44. WORKDIR /root
  45. COPY . teems
  46. WORKDIR /root/teems
  47. RUN make -j`nproc` App/teems Enclave/enclave.so Client/clients