SlideShare a Scribd company logo
容器技術課程
GitLab CI 應用 Philipz
鄭淳尹
容器與 Gitlab CI 應用
課程大綱
1. GitLab 簡介
2. GitLab CI 使用說明
3. GitLab CI 與雲端 Azure PaaS 整合
4. GitLab CI 與資料科學整合
5. GitLab CI 與 IoT 整合
6. GitLab CI 與 K8S 整合
7. 結語
1. GitLab 簡介
容器式系統架構
持續整合(Continuous Integration)
● 虛擬機方式
○ Jenkins
○ TravisCI
○ 舊式、肥大
● 容器方式
○ GitLab
○ CircleCI
○ 新式、輕量
解決軟體開發長久以來常見的痛
Docker更容易實現基礎架構程式化
GitHub
GitLab
Jenkins Registry
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
2. GitLab CI 使用說明
持續整合(CI)/持續交付(CD)
Install Git
● sudo apt-get install git
● Git cmd for windows
● SourceTree is best choice!
● GitHub is a git web-UI and repository.
● Git 教室
容器與 Gitlab CI 應用
GitLab-Runner
GitLab-Runner
GitLab-Runner
容器開發流程
容器與 Gitlab CI 應用
GitLab CI YAML
image: ruby:2.1
services:
- postgres
before_script:
- bundle install
after_script:
- rm secrets
GitLab CI Examples, Docker
用 GitLab CI 进行持续集成
stages:
- build
- test
- deploy
job1:
stage: build
script:
- execute-script-for-job1
only:
- master
3. GitLab CI 與雲端 Azure
PaaS 整合
GitLab
容器與 Gitlab CI 應用
Azure Pipeline
.gitlab-ci.yml (build)
image: docker:latest
services:
- docker:dind
stage:
- build
- test
- deploy
- release
before_script:
- docker info
build:
stage: build
script:
- docker build . -t registry.gitlab.com
- docker login -u gitlab-ci-token -p $T
- docker push registry.gitlab.com/$IMG
.gitlab-ci.yml (test)
test:
stage: test
script:
- docker login -u gitlab-ci-token -p $CI_Token registry.gitlab.com
- docker pull registry.gitlab.com/$USER/$IMG:$TAG
- docker network create wrktest
- docker run -d -p 1337:1337 --name app --network wrktest $IMG
- sleep 5
- docker run --name wrk --network wrktest --rm williamyeh/wrk -t2
-c5 -d5s --timeout 2s http://app:1337/ > test/result.txt
- apk add --update bash bc
- cd test && cat result.txt && ./test.sh
.gitlab-ci.yml (deploy)
deploy:
stage: deploy
script:
- docker login -u gitlab-ci-token -p $CI_Token registry.gitlab.com
- docker pull registry.gitlab.com/$USER/$IMG:$TAG
- docker login -u azure -p $AZURE_DOCKER_PASS dockware.azurecr.io
- docker tag registry.gitlab.com/$USR/$IMG dockware.azurecr.io/$IMG
- docker push dockware.azurecr.io/$IMG
.gitlab-ci.yml (release)
release:
stage: release
script:
- docker pull azuresdk/azure-cli-python:0.2.8
- docker run -t --rm -v $(pwd)/release.sh:/release.sh -e
AZURE_LOGIN_USER=$AZURE_LOGIN_USER -e AZURE_PASSWORD=$AZURE_PASSWORD
-e AZURE_TENANT=$AZURE_TENANT -e DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
-e DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG -e
AZURE_REG_PASSWORD=$AZURE_DOCKER_PASS azuresdk/azure-cli-python:0.2.8
/release.sh
4. GitLab CI 與資料科學
fast-science/background-removal-server
容器與 Gitlab CI 應用
Pipeline Schedules
5. GitLab CI 與 IoT 整合
Docker Autobuild
Public Docker Hub
Private Docker Registry, Distribution
Building ARM containers on any x86
machine, even DockerHub
GitHub source code
Resin.io - IoT DevOps platform
Only One Command
docker-compose.yml
&
docker-compose up
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
6. GitLab CI 與 K8S 整合
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
GitLab Auto DevOps
Canary Deployment
金絲雀部署
只部署部分實例
即早發現問題
藍綠部署
A/B Testing
Environments
Environments
7. 結語
Microservices Java Worker
Docker Birthday #3 training
Still No Silver Bullet
容器只是其中一個關鍵,並非全部
DevOps pipeline 軟體開發流程
Microservices微服務,或其他架構
Infrastructure as Code
Business model
*業務系統
無伺服器
微服務架構
Kubernetes
基礎架構
即程式碼
容器式
設計
Auto DevOps
容器與 Gitlab CI 應用
Docker 線上自學網站
Docker 從入門到實踐
gitbook.com/book/philipzheng/docker_p
ractice/
Docker 線上自學網站
Docker 從入門到實踐
gitbook.com/book/philipzheng/docker_p
ractice/
Thank you
Docker可省下比金錢更寶貴的時間!

More Related Content

What's hot (20)

PPTX
쿠버네티스 ( Kubernetes ) 소개 자료
Opennaru, inc.
 
PDF
目grep入門 +解説
murachue
 
PDF
Zero downtime deployment of micro-services with Kubernetes
Wojciech Barczyński
 
PDF
ゼロからはじめるKVM超入門
VirtualTech Japan Inc.
 
PDF
twMVC#44 讓我們用 k6 來進行壓測吧
twMVC
 
PDF
Container Network Interface: Network Plugins for Kubernetes and beyond
KubeAcademy
 
PDF
Kubernetes 101
Crevise Technologies
 
PPTX
AKS と ACI を組み合わせて使ってみた
Hideaki Aoyagi
 
PDF
5分で分かるgitのrefspec
ikdysfm
 
PPTX
Dockerからcontainerdへの移行
Akihiro Suda
 
PDF
eStargzイメージとlazy pullingによる高速なコンテナ起動
Kohei Tokunaga
 
PDF
Protocol Buffers 入門
Yuichi Ito
 
PDF
今だからこそ知りたい Docker Compose/Swarm 入門
Masahito Zembutsu
 
PDF
OCIランタイムの筆頭「runc」を俯瞰する
Kohei Tokunaga
 
PDF
微服務對IT人員的衝擊
Philip Zheng
 
PPTX
GitLab과 Kubernetes를 통한 CI/CD 구축
철구 김
 
PDF
WebAssemblyのWeb以外のことぜんぶ話す
Takaya Saeki
 
PDF
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Masahito Zembutsu
 
PDF
The Usage and Patterns of MagicOnion
Yoshifumi Kawai
 
PDF
Kubernetes Basics
Eueung Mulyana
 
쿠버네티스 ( Kubernetes ) 소개 자료
Opennaru, inc.
 
目grep入門 +解説
murachue
 
Zero downtime deployment of micro-services with Kubernetes
Wojciech Barczyński
 
ゼロからはじめるKVM超入門
VirtualTech Japan Inc.
 
twMVC#44 讓我們用 k6 來進行壓測吧
twMVC
 
Container Network Interface: Network Plugins for Kubernetes and beyond
KubeAcademy
 
Kubernetes 101
Crevise Technologies
 
AKS と ACI を組み合わせて使ってみた
Hideaki Aoyagi
 
5分で分かるgitのrefspec
ikdysfm
 
Dockerからcontainerdへの移行
Akihiro Suda
 
eStargzイメージとlazy pullingによる高速なコンテナ起動
Kohei Tokunaga
 
Protocol Buffers 入門
Yuichi Ito
 
今だからこそ知りたい Docker Compose/Swarm 入門
Masahito Zembutsu
 
OCIランタイムの筆頭「runc」を俯瞰する
Kohei Tokunaga
 
微服務對IT人員的衝擊
Philip Zheng
 
GitLab과 Kubernetes를 통한 CI/CD 구축
철구 김
 
WebAssemblyのWeb以外のことぜんぶ話す
Takaya Saeki
 
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Masahito Zembutsu
 
The Usage and Patterns of MagicOnion
Yoshifumi Kawai
 
Kubernetes Basics
Eueung Mulyana
 

Viewers also liked (17)

PDF
容器與資料科學應用
Philip Zheng
 
PDF
HITCON駭客戰隊與CTF經驗分享
Alan Lee
 
PDF
容器與IoT端點應用
Philip Zheng
 
PPTX
容器驅動開發 - .NET Conf 2017 @ 台中
Andrew Wu
 
PDF
用 Bitbar Tool 寫 Script 自動擷取外幣
Win Yu
 
PDF
企業導入容器經驗分享與開源技能培養
Philip Zheng
 
PDF
聊天機器人:一個沒有小編的世界
佳新 陳
 
PDF
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
PDF
Docker 進階實務班
Philip Zheng
 
PDF
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
Win Yu
 
PPTX
API Token 入門
Andrew Wu
 
PDF
與設計架構當朋友
Win Yu
 
PPTX
大型 Web Application 轉移到 微服務的經驗分享
Andrew Wu
 
PDF
Continuous Delivery - 敏捷開發的最後一哩路
Miles Chou
 
PDF
PHP 良好實踐 (Best Practice)
Win Yu
 
PDF
無瑕的程式碼 Clean Code 心得分享
Win Yu
 
PDF
[系列活動] 一天搞懂對話機器人
台灣資料科學年會
 
容器與資料科學應用
Philip Zheng
 
HITCON駭客戰隊與CTF經驗分享
Alan Lee
 
容器與IoT端點應用
Philip Zheng
 
容器驅動開發 - .NET Conf 2017 @ 台中
Andrew Wu
 
用 Bitbar Tool 寫 Script 自動擷取外幣
Win Yu
 
企業導入容器經驗分享與開源技能培養
Philip Zheng
 
聊天機器人:一個沒有小編的世界
佳新 陳
 
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Docker 進階實務班
Philip Zheng
 
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
Win Yu
 
API Token 入門
Andrew Wu
 
與設計架構當朋友
Win Yu
 
大型 Web Application 轉移到 微服務的經驗分享
Andrew Wu
 
Continuous Delivery - 敏捷開發的最後一哩路
Miles Chou
 
PHP 良好實踐 (Best Practice)
Win Yu
 
無瑕的程式碼 Clean Code 心得分享
Win Yu
 
[系列活動] 一天搞懂對話機器人
台灣資料科學年會
 
Ad

Similar to 容器與 Gitlab CI 應用 (20)

PDF
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Chu-Siang Lai
 
PDF
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境
均民 戴
 
PPTX
用 Drone 打造 輕量級容器持續交付平台
Bo-Yi Wu
 
PPT
Software Engineer Talk
Larry Cai
 
PDF
Git 入门实战
icy leaf
 
PDF
Build Your Own Android Toolchain from scratch
National Cheng Kung University
 
PDF
Bitbucket pipeline CI
Zero Huang
 
PDF
Git in a nutshell
Nelson Tai
 
PDF
Docker 123
WeiChih Ting
 
PDF
Docker容器微服務 x WorkShop
Philip Zheng
 
PDF
How to integrate GitLab CICD into B2B service
Alex Su
 
DOC
Android系统移植技术详解
zzc89522
 
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (5th)
Chu-Siang Lai
 
ODP
Clojure cnclojure-meetup
sunng87
 
PPTX
認識 Docker
協哲 蔡
 
PDF
Kubernetes device plugins
ssuser75c76a2
 
PDF
Git 簡介(古時候的簡報備份)
Hsin-lin Cheng
 
PDF
First meetingwithgit
Rhythm Sun
 
PPTX
Git & git hub v1.2
Chris Chen
 
PPT
Git 超簡單學習懶人包(軟體程式版本控管系統)
flylon
 
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Chu-Siang Lai
 
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境
均民 戴
 
用 Drone 打造 輕量級容器持續交付平台
Bo-Yi Wu
 
Software Engineer Talk
Larry Cai
 
Git 入门实战
icy leaf
 
Build Your Own Android Toolchain from scratch
National Cheng Kung University
 
Bitbucket pipeline CI
Zero Huang
 
Git in a nutshell
Nelson Tai
 
Docker 123
WeiChih Ting
 
Docker容器微服務 x WorkShop
Philip Zheng
 
How to integrate GitLab CICD into B2B service
Alex Su
 
Android系统移植技术详解
zzc89522
 
Continuous Delivery Workshop with Ansible x GitLab CI (5th)
Chu-Siang Lai
 
Clojure cnclojure-meetup
sunng87
 
認識 Docker
協哲 蔡
 
Kubernetes device plugins
ssuser75c76a2
 
Git 簡介(古時候的簡報備份)
Hsin-lin Cheng
 
First meetingwithgit
Rhythm Sun
 
Git & git hub v1.2
Chris Chen
 
Git 超簡單學習懶人包(軟體程式版本控管系統)
flylon
 
Ad

More from Philip Zheng (20)

PDF
AI Coding工具介紹 - 革新程式開發流程的智能助手 by Philipz
Philip Zheng
 
PDF
Solo Leveling with Cursor by Philipz 鄭淳尹
Philip Zheng
 
PDF
十二項架構設計原則
Philip Zheng
 
PDF
從零開始做架構圖
Philip Zheng
 
PDF
VSCode Remote Development 介紹
Philip Zheng
 
PDF
VSCode Remote Development
Philip Zheng
 
PPTX
K8s removes dockershime
Philip Zheng
 
PPTX
Apahce Ignite
Philip Zheng
 
PDF
Cloud Native Practice
Philip Zheng
 
PDF
容器式高效率 ChatBot 開發方法
Philip Zheng
 
PDF
理財機器人技術簡介與實作經驗分享
Philip Zheng
 
PDF
理財機器人技術簡介與實作經驗分享
Philip Zheng
 
PDF
Docker + CI pipeline 的高效率 ChatBot 開發方法
Philip Zheng
 
PDF
桃園市教育局Docker技術入門與實作
Philip Zheng
 
PDF
桃園市教育局Docker技術入門與實作
Philip Zheng
 
PDF
手把手帶你學 Docker 入門篇
Philip Zheng
 
PDF
程式交易介紹及 FinTech 創作分享
Philip Zheng
 
PDF
容器式軟體開發介紹
Philip Zheng
 
PDF
人工智能在量化投资分析中的实践
Philip Zheng
 
PDF
Trading bot演算法與軟工在程式交易上的實踐
Philip Zheng
 
AI Coding工具介紹 - 革新程式開發流程的智能助手 by Philipz
Philip Zheng
 
Solo Leveling with Cursor by Philipz 鄭淳尹
Philip Zheng
 
十二項架構設計原則
Philip Zheng
 
從零開始做架構圖
Philip Zheng
 
VSCode Remote Development 介紹
Philip Zheng
 
VSCode Remote Development
Philip Zheng
 
K8s removes dockershime
Philip Zheng
 
Apahce Ignite
Philip Zheng
 
Cloud Native Practice
Philip Zheng
 
容器式高效率 ChatBot 開發方法
Philip Zheng
 
理財機器人技術簡介與實作經驗分享
Philip Zheng
 
理財機器人技術簡介與實作經驗分享
Philip Zheng
 
Docker + CI pipeline 的高效率 ChatBot 開發方法
Philip Zheng
 
桃園市教育局Docker技術入門與實作
Philip Zheng
 
桃園市教育局Docker技術入門與實作
Philip Zheng
 
手把手帶你學 Docker 入門篇
Philip Zheng
 
程式交易介紹及 FinTech 創作分享
Philip Zheng
 
容器式軟體開發介紹
Philip Zheng
 
人工智能在量化投资分析中的实践
Philip Zheng
 
Trading bot演算法與軟工在程式交易上的實踐
Philip Zheng
 

容器與 Gitlab CI 應用