【docker】jenkins+webhook快速部署應用
阿新 • • 發佈:2019-01-23
Docker + Jenkins + Webhook(碼雲)快速部署應用
環境
- docker (ubuntu aliyun)
- jenkins (ubuntu aliyun)
注:docker和jenkins分佈在不同的伺服器上
首先安裝在ubuntu Xenial 16.04 and newer上安裝docker:(參考:官方文件)
$ sudo apt-get remove docker docker-engine docker.io $ sudo apt-get update $ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - $ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" $ sudo apt-get update $ sudo apt-get install docker-ce
我的jenkins也是在docker容器裡跑的:
$ docker run -d --name jenkins \
-p 8080:8080 -p 50000:50000 \
-v /srv/jenkins:/var/jenkins_home \
jenkins/jenkins:latest