Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
drone.ioを使って docker build & push自動化
Search
jsoizo
October 14, 2015
Technology
2.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
drone.ioを使って docker build & push自動化
Docker LT 20151014
jsoizo
October 14, 2015
More Decks by jsoizo
See All by jsoizo
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
210
小さくはじめるPeoperty Based Testing
jsoizo
1
1.1k
kotlinxライブラリの歩き方 〜 Kotlin公式エコシステムを使いこなす〜
jsoizo
1
270
はじめて関数型言語の機能に触れるエンジニア向けの学び方/教え方 / how-to-learn-or-teach-for-fp-beginner
jsoizo
5
1.6k
よくつかっているIterableの自作extensionを紹介します
jsoizo
0
130
HARD THINGS in Ad-Tech Engineering
jsoizo
1
1k
“エンジニア35才定年説に挑戦する” 開発チームのマネジメント
jsoizo
41
16k
Other Decks in Technology
See All in Technology
AmplifyHostingConstructからSSRフレームワークのためのホスティング設計を考察する/amplify-hosting-construct
fossamagna
1
240
Empower GenAI with Agile - あなたのアジャイルが生成AIのバフになる仕組み
hageyahhoo
1
210
AIと共生する開発者プラットフォーム:バクラクのモノレポ×マイクロサービス基盤
sakajunquality
2
3.8k
企業でAWS Organizationsを動かすための組織設計の考え方
nrinetcom
PRO
1
110
ZOZOTOWNの進化と信頼性を両立する負荷試験
zozotech
PRO
2
190
AI Agent SaaS を支える自社仮想化基盤への挑戦と実運用 / ai-agent-saas-virtualization
flatt_security
3
4.2k
ボーイスカウトルールでメモリやスキルを改善しよう
azukiazusa1
4
1.4k
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
1
280
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
1
220
生成AI×AWS CDK×AWS FISで"振り返れる"ミニGameDayをつくろう
yoshimi0227
1
400
関数型の考えを TypeScript に持ち込んで、テストしやすい純粋関数を増やす / Pure at the Core, Effects at the Edge: Bringing Functional Thinking into TypeScript
kaminashi
2
130
マルチアカウント環境でSecurity Hubの運用、その後どうなった? / SRE NEXT 2026 miniLT会
genda
0
100
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
340
エンジニアに許された特別な時間の終わり
watany
108
250k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Crafting Experiences
bethany
1
220
Transcript
drone.ioΛͬͯ docker build & pushࣗಈԽ Oct. 14, 2015 / Docker
LT @jsoizo
whoami • ໊લ : @jsoizo / Jun Sakamoto • ݴޠ
: JavaScriptͱScalaΛগʑ • ࣄ : ࠂωοτϫʔΫͷ։ൃ • ৴αʔόͰ70΄Ͳͷίϯςφ͕ৗ࣌ىಈ on Prod • ॴଐ :
·͍ʹͪ DockerͬͯΔͱ…
Πϝʔδͷ build & push ͔ͬͨΔ͍
Πϝʔδͷ build & push ͔ͬͨΔ͍ 4DBMBίϯύΠϧ͍
Πϝʔδͷ build & push ͔ͬͨΔ͍ 4DBMBίϯύΠϧ͍ ΄΅खಈ(*U'MPX
Πϝʔδͷ build & push ͔ͬͨΔ͍ 4DBMBίϯύΠϧ͍ ΠϝʔδQVTIͷʹ ଠฏ༸ͷ͜͏ͱ௨৴ ΄΅खಈ(*U'MPX
ͱ͍͏͜ͱͰ ࣗಈԽ
None
• goݴޠͰॻ͔ΕͨCI (ݱߦόʔδϣϯ0.3) • OSS൛ https://github.com/drone/drone • δϣϒຖʹDocker ίϯςφΛ্ཱ࣮ͪ͛ͯߦ •
GitHub, GitLabͷhook • gitϦϙδτϦԼͷyamlʹ࣮ߦ༰Λهड़ • irc, Slack, Hipchatͷ௨(by Plugin)
ಈ࡞ϑϩʔ ίϯςφ ᶄ webhook ᶆ docker run ᶅ read drone.yml
ᶉ docker push ᶇ test ᶈ docker builld ᶃ git push
ͬͯΔ͜ͱ ཁ͢Δʹ
Docker in Docker
ͪͳΈʹ ެࣜͷϓϥάΠϯ ͋ΔΑ
None
υΩϡϝϯτҰ ͳ͍͚Ͳͳ!!!
ͻΔ͕͑ͬͯ Docker in Docker
ϑΝΠϧߏ ※ Χοίͷલ߲ͷ࣮ߦॱ % tree -L 2 -a . ├──
.drone.yml // ઃఆϑΝΠϧ ᶅ ├── Dockerfile // ͓ͳ͡ΈϏϧυઃఆ ᶈ ├── activator └── drone ├── build.sh // docker build ᶈ&ᶉ └── test.sh // ςετ࣮ߦ༻sh ᶇ
drone.yml image: jsoizo/java:openjdk-8u66-jdk cache: - /root/.ivy2/cache script: - /bin/sh +x
drone/test.sh - /bin/sh +x drone/build.sh notify: slack: webhook_url: 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxx' username: 'drone' channel: '@jsoizo' on_started: false on_success: true on_failure: true
image: jsoizo/java:openjdk-8u66-jdk cache: - /root/.ivy2/cache script: - /bin/sh +x drone/test.sh
- /bin/sh +x drone/build.sh notify: slack: webhook_url: 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxx' username: 'drone' channel: '@jsoizo' on_started: false on_success: true on_failure: true JNBHFίϯςφͷΠϝʔδ drone.yml
image: jsoizo/java:openjdk-8u66-jdk cache: - /root/.ivy2/cache script: - /bin/sh +x drone/test.sh
- /bin/sh +x drone/build.sh notify: slack: webhook_url: 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxx' username: 'drone' channel: '@jsoizo' on_started: false on_success: true on_failure: true drone.yml DBDIF࠶ར༻ΛΩϟογϡ
image: jsoizo/java:openjdk-8u66-jdk cache: - /root/.ivy2/cache script: - /bin/sh -x drone/test.sh
- /bin/sh -x drone/build.sh notify: slack: webhook_url: 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxx' username: 'drone' channel: '@jsoizo' on_started: false on_success: true on_failure: true TDSJQUࣗಈԽ͍ͨ͠ॲཧ drone.yml
image: jsoizo/java:openjdk-8u66-jdk cache: - /root/.ivy2/cache script: - /bin/sh +x drone/test.sh
- /bin/sh +x drone/build.sh notify: slack: webhook_url: 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxx' username: 'drone' channel: '@jsoizo' on_started: false on_success: true on_failure: true OPUJGZྃ௨ઌ drone.yml
test.sh #!/bin/bash -eu # ςετ࣮ߦ ./activator test
build.sh #!/bin/bash -eu # DockerσʔϞϯىಈ /usr/local/bin/wrapdocker & sleep 5 DRONE_COMMIT_SHORT=`git
rev-parse --short ${DRONE_COMMIT}` # quay.ioʹϩάΠϯ docker login -e="." -u="jsoizo+drone_20151014" -p="XXXXXXXXXXX" quay.io # build docker build -t quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-${DRONE_COMMIT_SHORT} . # push docker push quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-${DRONE_COMMIT_SHORT} # DockerσʔϞϯऴྃ start-stop-daemon --stop --pidfile "/var/run/docker.
#!/bin/bash -eu # DockerσʔϞϯىಈ /usr/local/bin/wrapdocker & sleep 5 DRONE_COMMIT_SHORT=`git rev-parse
--short ${DRONE_COMMIT}` # quay.ioʹϩάΠϯ docker login -e="." -u="jsoizo+drone_20151014" -p="XXXXXXXXXXX" quay.io # build docker build -t quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-${DRONE_COMMIT_SHORT} . # push docker push quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-${DRONE_COMMIT_SHORT} # DockerσʔϞϯऴྃ start-stop-daemon --stop --pidfile "/var/run/docker. build.sh MPHJO
#!/bin/bash -eu # DockerσʔϞϯىಈ /usr/local/bin/wrapdocker & sleep 5 DRONE_COMMIT_SHORT=`git rev-parse
--short ${DRONE_COMMIT}` # quay.ioʹϩάΠϯ docker login -e="." -u="jsoizo+drone_20151014" -p="XXXXXXXXXXX" quay.io # build docker build -t quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-$ {DRONE_COMMIT_SHORT} . # push docker push quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-${DRONE_COMMIT_SHORT} # DockerσʔϞϯऴྃ build.sh CVJME
#!/bin/bash -eu # DockerσʔϞϯىಈ /usr/local/bin/wrapdocker & sleep 5 DRONE_COMMIT_SHORT=`git rev-parse
--short ${DRONE_COMMIT}` # quay.ioʹϩάΠϯ docker login -e="." -u="jsoizo+drone_20151014" -p="XXXXXXXXXXX" quay.io # build docker build -t quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-${DRONE_COMMIT_SHORT} . # push docker push quay.io/jsoizo/play-docker-lt-20151014:${DRONE_BRANCH}-$ {DRONE_COMMIT_SHORT} # DockerσʔϞϯऴྃ build.sh QVTI
ͪͳΈʹ
Registry :
• CoreOS͕ࣾӡӦ͢ΔDocker Registry • “͖ʔ͍͓͋ʔ”ͬͯಡΉͬΆ͍ʔ • DockerHubͱൺͯ • (࠾༻࣌) ΠϝʔδͷDL͕͔ͬͨ
• [ࢲݟ] Web UIͷૢ࡞ੑ͕ྑ͍ • DockerHubΈͨ͘ token Ͱpushͱ͔ग़དྷͳ͍͕ • RobotΞΧϯτΛ࡞ΕΔ => ࣗಈԽͷ͓ڙʹ
drone.ioࢼͯ͠Έͨ ݁ՌɺͲ͏Α???
ͱΓ͋͑ͣ ࣗಈԽग़དྷͨ
͕ɺ՝͕ࢁΓͰ վળͷ༨͋Γ
͕ɺ՝͕ࢁΓͰ վળͷ༨͋Γ '30.ͷΠϝʔδΛ ຖճ%-ͯ͠Δ (JU'MPXΛ ࣗಈԽͰ͖ͯͳ͍ Ϗϧυ࣌ʹ%-ͨ͠KBSΛ Ωϟογϡ͍ͨ͠
ҰํͰɺ ϙδςΟϒͳ
v0.4Ͱେ෯ʹ ػೳՃ͕͋Δ༷ https://github.com/drone/drone/tree/0.4.0 http://readme.drone.io/docs/build/index.html
ྫ) ίϯςφىಈ࣌ͷ Φϓγϣϯ͕૿͑Δ WPMVNFΛࢦఆͰ͖Δ ˠϗετͷTPDLFUϚϯτ͢Ε %PDLFSJO%PDLFS͔Βଔۀग़དྷͦ͏
ྫ) docker-compose෩ʹ αϙʔτίϯςφΛ ্͛ΒΕΕΔ FH"FSPTQJLFͳͲͷ ϨΞͳ%#ͷࢀরͱ͔ʹ
·ͱΊ
Summary • drone.io : golang CI • drone.ymlʹॻ͔Εͨͱ͓ΓʹϏϧυͯ͘͠ΕΔ • drone.ioڥԼͰͷdockerͷΠϝʔδϏϧυ
• Docker in Docker • pluginυΩϡϝϯτෆͰఘΊͨ • Service(link)Λ্ख͘͏ํ๏͕͋Γͦ͏ • ·ͩग़དྷΔ͜ͱগͳ͍(v0.3)ͷͰԿͰΓ͍ͨਓʹΩπΠ • v0.4Ͱվળ͞Εͦ͏
Thank You!!!