Dockerfile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/openssl_source
  18. RUN wget https://www.openssl.org/source/openssl-3.0.12.tar.gz
  19. WORKDIR /root/intel-sgx-ssl/Linux
  20. RUN make
  21. RUN make install
  22. WORKDIR /root
  23. RUN addgroup sgx
  24. RUN addgroup sgx_prv
  25. RUN adduser aesmd sgx
  26. RUN adduser aesmd sgx_prv
  27. COPY docker/start-aesmd /usr/local/sbin
  28. RUN chown aesmd.aesmd /var/run/aesmd
  29. RUN chmod 755 /usr/local/sbin/start-aesmd
  30. ENTRYPOINT ["/usr/local/sbin/start-aesmd"]
  31. # Remove the SGX SDK sources from the image
  32. FROM sgx AS sgx_no_source
  33. WORKDIR /root
  34. RUN rm -rf linux-sgx intel-sgx-ssl
  35. FROM scratch
  36. # Copy the sgx_no_source filesystem; this loses the history, but the
  37. # history contained the multi-GB SGX SDK sources that we have since
  38. # removed, so that's actually what we want.
  39. COPY --from=sgx_no_source / /
  40. RUN apt update && apt install -y libboost-dev libboost-thread-dev \
  41. numactl python3-numpy python3-yaml cpuid
  42. WORKDIR /root
  43. COPY . teems
  44. WORKDIR /root/teems
  45. RUN make -j`nproc` App/teems Enclave/enclave.so Client/clients