|
| 1 | +# Copyright The KCL Authors. All rights reserved. |
| 2 | + |
| 3 | +FROM centos:centos7 |
| 4 | + |
| 5 | +# macOS M1 --platform linux/amd64 |
| 6 | +# try fix "Problem with the SSL CA cert (path? access rights?)" |
| 7 | +# https://issueexplorer.com/issue/docker/for-mac/5912 |
| 8 | +# https://access.redhat.com/articles/2050743 |
| 9 | +RUN touch /etc/sysconfig/64bit_strstr_via_64bit_strstr_sse2_unaligned |
| 10 | + |
| 11 | +# --------------------------------------------------------------------------------- |
| 12 | +# Please note: The following steps are to install the dependency packages |
| 13 | +# needed to compile CPython for centos7, see the |
| 14 | +# [Python official website](https://devguide.python.org/setup/#install-dependencies) |
| 15 | +# for details. When the version of CPython used becomes higher, |
| 16 | +# please pay attention to update the installation dependencies. |
| 17 | +# --------------------------------------------------------------------------------- |
| 18 | + |
| 19 | +# Some language environments and plug-ins related to development and compilation, |
| 20 | +# such as git, CPython compilation, etc. |
| 21 | +RUN yum groupinstall -y "Development Tools" |
| 22 | +# Compiler and tool chain required to compile CPython such as gcc, make, sqlite3, ctype, struct, etc. |
| 23 | +RUN yum install -y gcc patch libffi-devel python-devel zlib-devel bzip2-devel ncurses-devel sqlite-devel |
| 24 | +RUN yum install -y libpcap-devel xz-devel readline-devel tk-devel gdbm-devel db4-deve |
| 25 | +# Install the system libraries required by python3 for UNIX based systems |
| 26 | +RUN yum -y install yum-utils |
| 27 | +RUN yum-builddep -y python3 |
| 28 | +# The python zlib module dependency package is required when compiling the python source code, |
| 29 | +# in order to use the modules that require zlib, such as setuptools, etc. |
| 30 | +RUN yum install -y zlib* |
| 31 | +# The python ssl module dependency package is required when compiling the python source code, |
| 32 | +# in order to use the modules that require ssl, such as pip3, twine, etc. |
| 33 | +RUN yum install -y openssl-devel |
| 34 | + |
| 35 | +# Install which |
| 36 | +RUN yum install -y which |
| 37 | + |
| 38 | +# Install wget |
| 39 | +RUN yum install -y wget |
| 40 | + |
| 41 | +# Install git-2.x |
| 42 | +# RUN yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm |
| 43 | +# RUN yum -y install git |
| 44 | + |
| 45 | +# rust |
| 46 | +# https://www.rust-lang.org/tools/install |
| 47 | +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y |
| 48 | +ENV PATH="/root/.cargo/bin:${PATH}" |
| 49 | +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true |
| 50 | + |
| 51 | +RUN cargo version |
| 52 | +RUN rustc --version |
| 53 | + |
| 54 | +# wasm |
| 55 | +RUN rustup target add wasm32-unknown-unknown |
| 56 | + |
| 57 | +# Install clang7 and llvm7 |
| 58 | +# https://www.softwarecollections.org/en/scls/rhscl/llvm-toolset-7.0/ |
| 59 | +# |
| 60 | +# 1. Install a package with repository for your system: |
| 61 | +# On CentOS, install package centos-release-scl available in CentOS repository: |
| 62 | +# $ sudo yum install centos-release-scl |
| 63 | +# |
| 64 | +# On RHEL, enable RHSCL repository for you system: |
| 65 | +# $ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms |
| 66 | +# |
| 67 | +# 2. Install the collection: |
| 68 | +# $ sudo yum install llvm-toolset-7.0 |
| 69 | +# |
| 70 | +# 3. Start using software collections: |
| 71 | +# $ scl enable llvm-toolset-7.0 bash |
| 72 | + |
| 73 | +RUN yum -y install centos-release-scl |
| 74 | +RUN yum-config-manager --enable rhel-server-rhscl-7-rpms |
| 75 | +RUN yum -y install llvm-toolset-7.0 |
| 76 | +RUN yum -y install llvm-toolset-7.0\* |
| 77 | +RUN scl enable llvm-toolset-7.0 bash |
| 78 | + |
| 79 | +# Install gcc7 |
| 80 | +RUN yum -y install devtoolset-7* |
| 81 | +RUN scl enable devtoolset-7 bash |
| 82 | +RUN gcc -v |
| 83 | + |
| 84 | +# rpm -ql llvm-toolset-7.0-clang.x86_64 |
| 85 | +# /opt/rh/llvm-toolset-7.0/root/usr/lib64/libLLVM-7.so |
| 86 | +ENV LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7.0/root/usr/lib64:${LD_LIBRARY_PATH}" |
| 87 | +ENV PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:${PATH}" |
| 88 | + |
| 89 | +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
| 90 | +RUN echo 'Asia/Shanghai' >/etc/timezone |
| 91 | + |
| 92 | +WORKDIR /root |
| 93 | + |
| 94 | +CMD ["bash"] |
0 commit comments