Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize DockerfileBase #437

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 26 additions & 59 deletions DockerfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -3,77 +3,44 @@ FROM ubuntu:20.04
RUN apt-get update && apt-get install software-properties-common -y && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get update && apt-get install -y \
autoconf \
automake \
build-essential \
cmake \
curl \
debhelper \
git \
libcurl4-openssl-dev \
libprotobuf-dev \
libssl-dev \
libtool \
lsb-release \
ocaml \
ocamlbuild \
protobuf-compiler \
python-is-python3 \
wget \
libcurl4 \
make \
unzip \
perl \
pkgconf

# RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb && \
# dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

RUN git clone -b sgx_2.19 --depth 1 https://github.com/intel/linux-sgx

RUN cd linux-sgx && make preparation
autoconf automake build-essential cmake curl debhelper git \
libcurl4-openssl-dev libprotobuf-dev libssl-dev libtool lsb-release \
ocaml ocamlbuild protobuf-compiler python-is-python3 wget libcurl4 \
make unzip perl pkgconf && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
git clone -b sgx_2.19 --depth 1 https://github.com/intel/linux-sgx && \
cd linux-sgx && make preparation

WORKDIR /linux-sgx
COPY . .

RUN make sdk_install_pkg_no_mitigation

WORKDIR /opt/intel
RUN sh -c 'echo yes | /linux-sgx/linux/installer/bin/sgx_linux_x64_sdk_*.bin'
RUN make sdk_install_pkg_no_mitigation && \
sh -c 'echo yes | /linux-sgx/linux/installer/bin/sgx_linux_x64_sdk_*.bin'

WORKDIR /linux-sgx
RUN make psw_install_pkg

WORKDIR /opt/intel
RUN cp /linux-sgx/linux/installer/bin/sgx_linux_x64_psw*.bin .
RUN ./sgx_linux_x64_psw*.bin --no-start-aesm
RUN make psw_install_pkg && \
cp /linux-sgx/linux/installer/bin/sgx_linux_x64_psw*.bin /opt/intel/ && \
./sgx_linux_x64_psw*.bin --no-start-aesm

COPY . /usr/src/sdk
RUN ls /usr/src/sdk/autoconf.bash
WORKDIR /usr/src/sdk

RUN apt update && \
apt install -yq apt-utils && \
apt install -yq --no-install-recommends vim telnet git ca-certificates perl \
reprepro libboost-all-dev alien uuid-dev libxml2-dev ccache \
yasm flex bison libprocps-dev ccache texinfo \
graphviz doxygen libgnutls28-dev libgcrypt20-dev \
libboost-dev libboost-system-dev libboost-thread-dev lsb-release libsystemd0 && \
# glibc-tools
ln -s /usr/bin/ccache /usr/local/bin/clang && \
RUN apt-get update && \
apt-get install -yq apt-utils git ca-certificates perl ccache \
libboost-all-dev alien uuid-dev libxml2-dev flex bison libprocps-dev \
texinfo libgnutls28-dev libgcrypt20-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/ccache /usr/local/bin/clang && \
ln -s /usr/bin/ccache /usr/local/bin/clang++ && \
ln -s /usr/bin/ccache /usr/local/bin/gcc && \
ln -s /usr/bin/ccache /usr/local/bin/g++ && \
ln -s /usr/bin/ccache /usr/local/bin/cc && \
ln -s /usr/bin/ccache /usr/local/bin/c++

RUN cd scripts && ./build_deps.py && \
wget --progress=dot:mega -O - https://github.com/intel/dynamic-application-loader-host-interface/archive/072d233296c15d0dcd1fb4570694d0244729f87b.tar.gz | tar -xz && \
cd dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b && \
cmake . -DCMAKE_BUILD_TYPE=Release -DINIT_SYSTEM=SysVinit && \
make install && \
cd .. && rm -rf dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b && \
cd /usr/src/sdk && \
./autoconf.bash && \
./configure && \
bash -c "make -j$(nproc)"
RUN cd scripts && ./build_deps.py && \
wget --progress=dot:mega -O - https://github.com/intel/dynamic-application-loader-host-interface/archive/072d233296c15d0dcd1fb4570694d0244729f87b.tar.gz | tar -xz && \
cd dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b && \
cmake . -DCMAKE_BUILD_TYPE=Release -DINIT_SYSTEM=SysVinit && make install && \
cd .. && rm -rf dynamic-application-loader-host-interface-072d233296c15d0dcd1fb4570694d0244729f87b

RUN ./autoconf.bash && ./configure && make -j$(nproc)