type
status
date
slug
summary
tags
category
icon
password
使用Docker Desktop安装kind
Install Docker Desktop on Mac
get docker desktop VM IP
e.g.
Install kubectl on macOS
Install kind on macOS
Creating a kubernetes cluster
get kubernetes cluster master IP
e.g.
安装Jenkins
Installing Jenkins in Docker
Customize the official Jenkins Docker image, by executing the following two steps:
Create a Dockerfile with the following content:
Build a new docker image from this Dockerfile, and assign the image a meaningful name, such as "myjenkins-blueocean:2.426.3-1":
docker build -t myjenkins-blueocean:2.426.3-1 .
Run your own myjenkins-blueocean:2.426.3-1 image as a container in Docker using the following docker run command:
get jenkins IP
e.g.
Unlocking Jenkins
使用jenkins
- jenkins提供多种任务模式,可以理解为不同语法的脚本(Jenkinsfile),包括freestyle project、pipeline、multi configuration pipeline等
- Jenkinsfile可以直接编辑文档,也可以通过UI生成,下一代UI blue ocean可以通过表单直接生成multi configuration pipeline类型的Jenkinsfile
- jenkins任务运行在所谓agent,有多种方式临时部署agent:docker container、kubernetes POD、node。如果将docker engine或者kubernetes cluster添加成cloud,貌似他们是以node方式部署agent,如何以container或者POD方式部署agent有待研究
e.g.
将kubernetes cluster添加成cloud
将docker engine添加成cloud
将docker engine添加成cloud这里有一个问题,macOS+docker desktop环境下,docker engine port无法通过daemon.json或者docker.service文件配置暴露,比较简单的一个办法是创建一个container将docker engine所在VM的port映射出来,比如我们创建一个IP为172.18.0.4的container:
创建一个POD template(定义当需要一个agent时,如何启动一个node)


创建一个pipeline

创建一个step



运行pipeline

结果

- Author:共倒金荷家万里
- URL:https://tangly1024.com/article/11140ef0-3786-8011-bc82-e4da7deb9049
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts