docker pull centos:centos7.4.1708
docker run -it --name centos7.4 -v /home/mobaxterm/mnt:/root/mnt centos:centos7.4.1708 bash
docker exec -it centos7.4 bash
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
yum install epel-release centos-release-scl centos-release-scl-rh
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo_bak
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo_bak
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
yum install net-tools
yum install bash-completion -y
sudo yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++
scl enable devtoolset-9 bash
source /opt/rh/devtoolset-9/enable
网络配置
cd /etc/sysconfig/network-scripts/
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
UUID="8fb06ecc-e011-4d26-ada9-cba29172617e"
DEVICE="eth0"
ONBOOT="yes"
HWADDR=00:0C:29:12:9D:B7
IPADDR=192.168.67.138
NETMASK=255.255.255.0
GATEWAY=192.168.67.2
IPV4_ROUTE_METRIC=99
DNS1=114.114.114.114
DNS2=114.114.115.115