docker run -d --name chat -v /dp/docker/file/glm:/usr/local/glm -p 8501:8501  -p7860:7860 -p 7861:7861  -p7862:7862  --privileged=true centos:7 /usr/sbin/init

#进入容器
docker exec -it -u root chat /bin/bash
yum install -y gcc patch libffi-devel python-devel  zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel  gcc-c++ gcc
yum install -y zlib* 
yum install -y net-tools.x86_64
yum install -y openssh-server 
yum install -y git
yum install -y wget
yum install -y python-setuptools
#git大文件管理要用到lfs
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sh
yum install git-lfs
git lfs install
python环境
conda方式 [centos 安装 Conda]


# 切换Python 3.12.2版本
conda activate PY3.12.2

# 创建并激活虚拟环境
python -m venv venv
source ./venv/bin/activate

升级gcc

先进入root。su,然后输入密码。
将gcc升级到9.3.1版本,使用下面的命令:
yum -y install centos-release-scl
yum install devtoolset-9-gcc*
scl enable devtoolset-9 bash
 
 
此时查看gcc版本:gcc -v
Thread model: posix
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)