|
| 1 | +# BSD License |
| 2 | +# |
| 3 | +# Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved. |
| 4 | +# |
| 5 | +# Redistribution and use in source and binary forms, with or without |
| 6 | +# modification, are permitted provided that the following conditions |
| 7 | +# are met: |
| 8 | +# |
| 9 | +# * Redistributions of source code must retain the above copyright |
| 10 | +# notice, this list of conditions and the following disclaimer. |
| 11 | +# * Redistributions in binary form must reproduce the above copyright |
| 12 | +# notice, this list of conditions and the following disclaimer in |
| 13 | +# the documentation and/or other materials provided with the |
| 14 | +# distribution. |
| 15 | +# * Neither the name of Baidu, Inc., nor the names of its |
| 16 | +# contributors may be used to endorse or promote products derived |
| 17 | +# from this software without specific prior written permission. |
| 18 | +# |
| 19 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 | +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 | +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 | +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 | +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 | +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 | +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | + |
| 31 | + |
| 32 | +FROM fedora:27 |
| 33 | +MAINTAINER Yu Ding |
| 34 | + |
| 35 | +ENV sdk_bin https://download.01.org/intel-sgx/latest/linux-latest/distro/fedora27-server/sgx_linux_x64_sdk_2.7.100.4.bin |
| 36 | +ENV psw_deb https://download.01.org/intel-sgx/latest/linux-latest/distro/fedora27-server/sgx_linux_x64_psw_2.7.100.4.bin |
| 37 | +ENV rust_toolchain nightly-2019-08-01 |
| 38 | +ENV DEBIAN_FRONTEND=noninteractive |
| 39 | + |
| 40 | +RUN yum groupinstall -y 'C Development Tools and Libraries' && yum install -y yum openssl-devel libcurl-devel protobuf-devel cmake ocaml ocaml-ocamlbuild redhat-rpm-config openssl-devel wget python |
| 41 | + |
| 42 | +RUN mkdir /root/sgx && \ |
| 43 | + mkdir /etc/init && \ |
| 44 | + wget -O /root/sgx/psw.bin ${psw_deb} && \ |
| 45 | + wget -O /root/sgx/sdk.bin ${sdk_bin} && \ |
| 46 | + cd /root/sgx && \ |
| 47 | + chmod +x /root/sgx/psw.bin && \ |
| 48 | + /root/sgx/psw.bin || true && \ |
| 49 | + chmod +x /root/sgx/sdk.bin && \ |
| 50 | + echo -e 'no\n/opt' | /root/sgx/sdk.bin && \ |
| 51 | + echo 'source /opt/sgxsdk/environment' >> /root/.bashrc && \ |
| 52 | + rm -rf /root/sgx/* |
| 53 | + |
| 54 | +RUN wget 'https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init' -O /root/rustup-init && \ |
| 55 | + chmod +x /root/rustup-init && \ |
| 56 | + echo '1' | /root/rustup-init --default-toolchain ${rust_toolchain} && \ |
| 57 | + echo 'source /root/.cargo/env' >> /root/.bashrc && \ |
| 58 | + /root/.cargo/bin/rustup component add rust-src rls rust-analysis clippy rustfmt && \ |
| 59 | + /root/.cargo/bin/cargo install xargo && \ |
| 60 | + rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git |
| 61 | +WORKDIR /root |
0 commit comments