使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程

安装Docker for mac

https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

  • 设置 Docker 国内镜像源

登录到阿里云,获得专属镜像地址

https://cr.console.aliyun.com/#/accelerator

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

设置镜像地址

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

几个简单常用命令


docker version //检查Docker 版本

docker search 镜像名称 //搜索是否有镜像

docker pull 镜像名称//拉取镜像

docker ps 显示运行中的容器, 可以加参数 -a 


查看镜像 docker images

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

删除Image镜像

docker rmi -f 镜像ID 或者镜像名称 

镜像被容器依赖,容器启动后禁止删除镜像,所以先需要批量删除容器
docker rm `docker ps --no-trunc -aq` 

安装NotifyQQ

地址:https://github.com/ameizi/NotifyQQ

1.克隆 https://github.com/ameizi/NotifyQQ.git 到本地

2.在NotifyQQ的根目录里面执行

docker build -t mojo-webqq .

3.启动

docker run -it --env MOJO_WEBQQ_LOG_ENCODING=utf8 -p 5000:5000 -v /tmp:/tmp mojo-webqq 

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》

4.启动后用浏览器打开这个地址,手机QQ打开小号扫码登录。

安装Jenkins

下载:

docker pull Jenkins

启动:

docker run -p 8080:8080 --name=jenkins-master jenkins

Jenkins启动时候要初始密码,路径为

/var/lib/docker/volumes/随机串目录/_data/secrets/initialAdminPassword 

如果Mac 下的没有/var/lib/docker 路径先执行下面的命令

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

随机串目录需要从 /var/lib/docker/volumes/下去寻找 Jenkins目录

参考:
https://www.58jb.com/html/109.html

创建一个构建任务

从“高级” 里面添加接收人的QQ号

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

保存后点立即构建

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

构建后点击构建记录

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

可以从console output 看到发送成功

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

QQ也能收到消息

《使用 Jenkins & NotifyQQ 在 Docker For mac 环境下的搭建过程》 image.png

Done!

    原文作者:zimo
    原文地址: https://www.jianshu.com/p/62f03d9dfe26
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞