blob: 63eb38639998fb6a7ce096cad99ab3dcc2c7aa19 [file] [log] [blame]
# BSD License
#
# Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Baidu, Inc., nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM centos:7
MAINTAINER Yu Ding
ENV sdk_bin https://download.01.org/intel-sgx/linux-2.6/centos7.5-server/sgx_linux_x64_sdk_2.6.100.51363.bin
ENV psw_deb https://download.01.org/intel-sgx/linux-2.6/centos7.5-server/sgx_linux_x64_psw_2.6.100.51363.bin
ENV rust_toolchain nightly-2019-08-01
ENV DEBIAN_FRONTEND=noninteractive
RUN yum groupinstall -y 'Development Tools' && yum install -y ocaml ocaml-ocamlbuild wget python openssl-devel protobuf which
RUN mkdir /root/sgx && \
mkdir /etc/init && \
wget -O /root/sgx/psw.bin ${psw_deb} && \
wget -O /root/sgx/sdk.bin ${sdk_bin} && \
cd /root/sgx && \
chmod +x /root/sgx/psw.bin && \
/root/sgx/psw.bin || true && \
chmod +x /root/sgx/sdk.bin && \
echo -e 'no\n/opt' | /root/sgx/sdk.bin && \
echo 'source /opt/sgxsdk/environment' >> /root/.bashrc && \
rm -rf /root/sgx/*
RUN wget 'https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init' -O /root/rustup-init && \
chmod +x /root/rustup-init && \
echo '1' | /root/rustup-init --default-toolchain ${rust_toolchain} && \
echo 'source /root/.cargo/env' >> /root/.bashrc && \
/root/.cargo/bin/rustup component add rust-src rls rust-analysis clippy rustfmt && \
/root/.cargo/bin/cargo install xargo && \
rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git
WORKDIR /root