vmware安装centos8
1、下载iso镜像:https://mirrors.aliyun.com/centos/8.5.2111/isos/x86_64/?spm=a2c6h.25603864.0.0.785544cbaVIkns

下载最小iso镜像
2、VMware安装

这里需要进行配置,不然通过不了:

https://mirrors.aliyun.com/centos/8.5.2111/BaseOS/x86_64/os这里复制不了,需要手打
3、修改ip:

重启网络网卡:
nmcli c load /etc/sysconfig/network-scripts/ifcfg-ens160
nmcli c up ens160
4、配置repo
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Linux-BaseOS.repo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.bakup [root@localhost ~]# rm -f /etc/yum.repos.d/*.repo [root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Linux-BaseOS.repo http://mirrors.aliyun.com/repo/Centos-8.repo [root@localhost ~]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Linux-BaseOS.repo [root@localhost ~]# yum install vim wget unzip
5、配置docker,并安装docker
cd /etc/yum.repos.d/ && wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum install docker-ce -y systemctl start docker systemctl status docker systemctl enable docker
6、配置安装node
[root@localhost ~]# curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash - [root@localhost ~]# yum install nodejs [root@localhost ~]# node -v v22.15.0 [root@localhost ~]# npm -v 10.9.2
7、配置安装jenkins:
[root@localhost ~]# yum install jdk-17.0.13_linux-x64_bin.rpm [root@localhost ~]# wget -O /etc/yum.repos.d/jenkins.repo --no-check-certificate https://pkg.jenkins.io/redhat-stable/jenkins.repo [root@localhost ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key [root@localhost ~]# yum install jenkins
启动报错:

解决办法:
[root@localhost ~]# dnf install fontconfig [root@localhost ~]# dnf install xorg-x11-fonts-* [root@localhost ~]# systemctl restart jenkins [root@localhost ~]# systemctl status jenkins ● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2025-05-14 08:26:47 EDT; 6s ago
当系统为centos7也有上述报错,解决办法:
yum install fontconfig freetype
8、docker安装jenkins
[root@localhost ~]# docker run --privileged -d -p 9090:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock://var/run/docker.sock -u root --restart=always --name=jenkins jenkins/jenkins [root@localhost ~]# docker exec -it jenkins /bin/bash root@e0b4b1ee9767:/# apt update root@e0b4b1ee9767:/# curl -fsSL https://deb.nodesource.com/setup_22.x | bash - root@e0b4b1ee9767:/# apt install nodejs root@e0b4b1ee9767:/# node -v v22.15.0 root@e0b4b1ee9767:/# npm -v 10.9.2
[root@localhost ~]# docker restart jenkins
jenkins
[root@localhost ~]# docker exec -it jenkins /bin/bash
root@e0b4b1ee9767:/# node -v
v22.15.0
浙公网安备 33010602011771号