一 背景说明
新版的jenkins由于一些k8s插件发现没了,没法使用之前的方法发布了,这次不使用任何插件,直接使用自由风格发布。jenkins是使用docker启动的,k8s环境是基于 1.23版本
二 docker运行jenkins
2.1 安装docker和docker-compase
2.1.1 安装docker环境-ubuntu系统
安装方法
https://www.runoob.com/docker/ubuntu-docker-install.html
自动安装
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
手动安装
安装 apt 依赖包,用于通过HTTPS来获取仓库:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
添加 Docker 的官方 GPG 密钥:
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-get install docker-ce docker-ce-cli containerd.io
2.1.2 安装docker环境-centos系统
安装方式
https://www.runoob.com/docker/centos-docker-install.html
#手动安装
安装所需的软件包。yum-utils 提供了 yum-config-manager ,并且 device mapper 存储驱动程序需要 device-mapper-persistent-data 和 lvm2
yum install -y yum-utils device-mapper-persistent-data lvm2
#设置指定仓库
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
#阿里云仓库
sudo yum-config-manager \
--add-repo \
http://mir