1.更改静态ip
[root@alma9 ~]# vi /etc/NetworkManager/system-connections/ens33.nmconnection
[connection]
id=ens33
uuid=b73f0e6f-2416-3779-9009-c18a3432f7c2
type=ethernet
autoconnect-priority=-999
interface-name=ens33
timestamp=1791728375
[ethernet]
[ipv4]
method=manual
addresses=11.0.1.100/24;11.0.1.2
dns=223.5.5.5;8.8.8.8
[ipv6]
addr-gen-mode=eui64
method=disabled
[proxy]
reboot
2.安装docker
指定版本安装时repo源对docker-ce-cli的版本支持,存在同版本支持docker-ce,docker-ce-cli却不支持的情况,例如docker-ce有18.06.03版本但是docker-ce-cli却没有这个版本。用yum list docker-ce --showduplicates|sort -r查看。
cd /etc/yum.repos.d
wget https://mirrors.aliyun.com/docker-ce/linux/rhel/docker-ce.repo
#默认最新版本,如果需要指定版本,需要指定docker-ce、docker-ce-cli为同一个版本,containerd.io不需要指定版本。
dnf install -y docker-ce docker-ce-cli containerd.io
换docker镜像源
mkdir -p /etc/docker
vi /etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://9cpn8tt6.mirror.aliyuncs.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com",
"https://docker.nju.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com",
"https://mirror.ccs.tencentyun.com",
"http://hub-mirror.c.163.com",
"https://dockerhub.azk8s.cn",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://registry.cn-hangzhou.aliyuncs.com"
]
}
systemctl restart docker
systemctl enable docker
#刷新配置文件
systemctl daemon-reload
systemctl restart docker
#测试运行
docker run hello-world
3.暂时/永久关闭防火墙
sudo systemctl stop firewalld
sudo systemctl disable firewalld
4.新系统dnf update
dnf update -y
5.换源,目前源比较换乱,暂不换源
自带的源目前下载速度还可以。
6.更换主机名
sudo hostnamectl set-hostname ***
bash