occlum/tools/docker/Dockerfile
2019-10-19 06:03:50 +00:00

94 lines
2.4 KiB
Docker

FROM ubuntu:16.04
LABEL maintainer="Tate, Hongliang Tian <tate.thl@antfin.com>"
RUN apt-get update && apt-get install -y --no-install-recommends \
alien \
autoconf \
automake \
build-essential \
ca-certificates \
cmake \
curl \
debhelper \
expect \
g++ \
gdb \
git-core \
jq \
kmod \
libboost-system-dev \
libboost-thread-dev \
libcurl4-openssl-dev \
libfuse-dev \
libjsoncpp-dev \
liblog4cpp5-dev \
libprotobuf-c0-dev \
libprotobuf-dev \
libssl-dev \
libtool \
libxml2-dev \
ocaml \
pkg-config \
protobuf-compiler \
python \
python-pip \
sudo \
unzip \
uuid-dev \
vim \
wget \
zip \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install cpuid tool for tests
WORKDIR /tmp
RUN wget http://www.etallen.com/cpuid/cpuid-20180519.x86_64.tar.gz && \
tar -xf ./cpuid-20180519.x86_64.tar.gz && \
cp ./cpuid-20180519/cpuid /usr/bin/ && \
rm -rf /tmp/cpuid-20180519*
# Install SGX SDK
WORKDIR /tmp
RUN git clone https://github.com/occlum/linux-sgx . && \
./download_prebuilt.sh && \
./compile.sh && \
./install.sh && \
echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc && \
rm -rf /tmp/linux-sgx
# Install Rust
ENV OCCLUM_RUST_VERSION=nightly-2019-01-28
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain ${OCCLUM_RUST_VERSION} -y && \
rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git
ENV PATH="/root/.cargo/bin:$PATH"
# Install Occlum toolchain
COPY toolchains/gcc/* /tmp/
WORKDIR /tmp
RUN ./build.sh
ENV PATH="/opt/occlum/build/bin:/usr/local/occlum/bin:$PATH"
# Install the latest version of Occlum
WORKDIR /root
RUN git clone https://github.com/occlum/occlum && \
cd occlum && \
make submodule && \
make RELEASE=1 && \
make install && \
cp -r demos /root/demos && \
rm -rf /root/occlum
# Start AESM service automatically
#
# To do so, we add the script to ~/.bashrc. We cannot use systemd to run AESM
# as a "real" service since the pid 1 is not systemd in Docker. So we start
# up AESM service when an user login with an interative shell.
COPY docker/start_aesm.sh /opt/occlum/
RUN echo '/opt/occlum/start_aesm.sh' >> /root/.bashrc
WORKDIR /root