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
元銀行員がAIだけでアプリを量産!「バイブコーディング実演セミナー 」
tatsuya1970
0
110
あなたの知らないPDFのアクセシビリティ
lycorptech_jp
PRO
0
240
作る力から、見極める力へ — AI時代に広がるエンジニアの価値と役割
rince
0
330
Deep Data Security 機能解説
oracle4engineer
PRO
2
110
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
1
1.8k
入門!AWS Blocks
ysuzuki
1
190
AIが自律的に回る開発ループを設計してチーム開発に組み込む
nekorush14
0
130
レガシーな広告配信システムでのAI駆動開発/運用の挑戦
i16fujimoto
0
120
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
20
7.4k
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
120
AIネイティブな開発のサプライチェーンリスク対策 〜激動の開発現場でリスクに立ち向かう〜【ZennFes】
cscengineer
PRO
2
160
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
240
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
980
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
230
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Unsuck your backbone
ammeep
672
58k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Writing Fast Ruby
sferik
630
63k
Accessibility Awareness
sabderemane
1
140
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
740
Optimising Largest Contentful Paint
csswizardry
37
3.7k
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!!!