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
小さくはじめるPeoperty Based Testing
jsoizo
1
1.1k
kotlinxライブラリの歩き方 〜 Kotlin公式エコシステムを使いこなす〜
jsoizo
1
260
はじめて関数型言語の機能に触れるエンジニア向けの学び方/教え方 / how-to-learn-or-teach-for-fp-beginner
jsoizo
5
1.5k
よくつかっている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
AWS Summit の片隅で、体育座りしながらコミュニティがにぎわう理由を考えた
k_adachi_01
2
330
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
7.8k
『AIに負けない』より『AIと遊ぶ』」〜ワクワクが最強のテスト・QA学習戦略_公開用
odan611
1
310
なぜ人は自分のプロジェクトを 「なんちゃってアジャイル」と 自嘲するのか
kozotaira
0
220
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
20
8.3k
サイバーエージェントにおけるAI推進戦略と変革への取り組み
shotatsuge
0
660
CVE-2026-20833_脆弱性対応とAES 化について
jukishiya
0
320
“全部コピーしない”ファイルデータの活用 : — FSx for ONTAP × S3 Tables × Icebergで作るメタデータカタログ
yoshiki0705
0
180
Agentic AI 時代のテスト手法: Kiro とはじめるプロパティベーステスト (AWS Summit Japan 2026 | DEV212)
ymhiroki
0
150
AIで政治は変わるのか? — 中高生と考えたAI時代の民主主義(東海高校サタデープログラム)
eitarosuda
0
330
Microsoft のサポートとフィードバック総まとめ
murachiakira
PRO
0
130
product engineering with qa
nealle
0
130
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
670
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
250
Making Projects Easy
brettharned
120
6.7k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
How GitHub (no longer) Works
holman
316
150k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Believing is Seeing
oripsolob
1
160
Statistics for Hackers
jakevdp
799
230k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
210
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!!!