Ubuntu18.04 Jenkins 安裝

Gary Ng
2 min readOct 12, 2020

--

1. 新增 repository key

wget -q -O — http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

如果成功會回傳 OK

2. 將 package repository address 加到 source list

sudo sh -c ‘echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list’

3. 更新 apt 以至於能使用到新的 repository

sudo apt update

4. 安裝 Jenkins

sudo apt-get install jenkins

5. 啟動 Jenkins

sudo systemctl start jenkins

6. 查看 Jenkins 狀態

sudo systemctl status jenkins

7. Ubuntu 會有防火牆 ufw 的問題, 可以開啟 port 也可以停止防火牆

sudo ufw disable ( 防火牆關閉)

sudo ufw allow 8080 ( 開啟 8080 port , jenkins 預設 port 為 8080

Docker Jenkins

version: "3.1"

services:
hiskio_jenkins:
build: "./docker/jenkins"
container_name: "hiskio_jenkins"
ports:
- 8888:8080
volumes:
- jenkins_data:/var/jenkins_home

volumes:
jenkins_data:

--

--

Gary Ng
Gary Ng

Written by Gary Ng

軟體工程師、後端工程師

No responses yet