jenkins镜像构建
[freedom@localhost ~]$ mkdir -pv docker/jenkins
mkdir: 已创建目录 "docker/jenkins"
[freedom@localhost ~]$ cd docker/jenkins/
[freedom@localhost jenkins]$
jenkins安装脚本:
[freedom@localhost jenkins]$ vim jenkins_install.sh
yum -y install wget gcc
yum -y install initscripts
touch /etc/yum.repos.d/jenkins.repo
cat >> /etc/yum.repos.d/jenkins.repo << EOF
[jenkins]
name=Jenkins-stable
baseurl=http://pkg.jenkins.io/redhat-stable
gpgcheck=1
EOF
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum -y upgrade
yum -y install epel-release java-11-openjdk-devel
yum -y install jenkins
[freedom@localhost jenkins]$
dockerfile文件:
[freedom@localhost jenkins]$ vim Dockerfile
FROM centos:7
COPY jenkins_install.sh /tmp/jenkins_install.sh
RUN sh /tmp/jenkins_install.sh
[freedom@localhost jenkins]$
构建jenkins镜像:
[freedom@localhost jenkins]$ sudo docker build -t freed
CentOS7.8-Docker构建Jenkins镜像
于 2024-05-27 23:40:12 首次发布