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
Dockerfileを素早く書くtips&ライブデモ
Search
Mitsuki Ogasahara
October 21, 2016
Technology
2
1.8k
Dockerfileを素早く書くtips&ライブデモ
2016/10/21 JX通信社の社内勉強会で話した内容です
Mitsuki Ogasahara
October 21, 2016
Tweet
Share
More Decks by Mitsuki Ogasahara
See All by Mitsuki Ogasahara
ひとり情シスなCTOがLLMと始めるオペレーション最適化 / CTO's LLM-Powered Ops
yamitzky
0
660
コスト管理から向き合う技術的負債 / Accounting for Technical Debt Through Cost Management
yamitzky
0
71
Utility-first な CSS-in-JS 〜Tailwind CSS と Chakra UI を添えて〜 / Utility-First CSS-in-JS
yamitzky
5
1.5k
今から始める型安全 Python / Start Python Type Hints
yamitzky
13
4.9k
技術が好きで好きで好きでたまらないエンジニアが「取締役」になって思う、マネジメントキャリアパス / My Manager's Path
yamitzky
2
1.2k
Python 3.9 時代の型安全な Pythonの極め方 / Mastering Type Safety in Python 3.9 Era
yamitzky
35
31k
なぜサーバーレスとDockerなのか 〜 インフラ運用を最小化するサービス開発 〜 / Why We Choose Serverless AND Docker
yamitzky
0
4.1k
サーバーレスを活用して少数精鋭で開発するニュースアプリ #devsumi
yamitzky
4
3k
ここが辛いよサーバーレス だが私は乗り越えた #builderscon
yamitzky
14
7.9k
Other Decks in Technology
See All in Technology
「エッジ×分散生成AI」の技術と変わる産業、そしてITの未来
piacerex
0
100
モノタロウ x クリエーションラインで実現する チームトポロジーにおける プラットフォームチーム・ ストリームアラインドチームの 効果的なコラボレーション
creationline
0
210
コールドスタンバイ構成でCDは可能か
hiramax
0
130
戰略轉變:從建構 AI 代理人到發展可擴展的技能生態系統
appleboy
0
170
First-Principles-of-Scrum
hiranabe
1
370
チームで安全にClaude Codeを利用するためのプラクティス / team-claude-code-practices
tomoki10
0
650
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
290
ECS_EKS以外の選択肢_ROSA入門_.pdf
masakiokuda
1
120
Agentic AIが変革するAWSの開発・運用・セキュリティ ~Frontier Agentsを試してみた~ / Agentic AI transforms AWS development, operations, and security I tried Frontier Agents
yuj1osm
0
180
ハッカソンから社内プロダクトへ AIエージェント ko☆shi 開発で学んだ4つの重要要素
leveragestech
0
510
Introduction to Bill One Development Engineer
sansan33
PRO
0
340
Claude Skillsの テスト業務での活用事例
moritamasami
1
130
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
64
Un-Boring Meetings
codingconduct
0
170
GraphQLとの向き合い方2022年版
quramy
50
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
260
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
410
How Software Deployment tools have changed in the past 20 years
geshan
0
30k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
200
Transcript
@yamitzky %PDLFSpMFΛ ૉૣ͘࡞Δ UJQTˍϥΠϒσϞ 2016/10/21 JXࣾษڧձ
w ͕ࣗ%PDLFSpMFΛॻ͘ͱ͖ʹɺ Ͳ͏͍͏ڥͰॻ͍͍ͯΔ͔Λڞ༗ˍσϞ͠·͢ w ʮ͜͏͢Δͱͬͱޮྑ͍ΑʂʯͳͲ͋ͬͨΒ ϚαΧϦ͓ئ͍͠·͢ Today…
w ίϯςφܕͷԾԽڥΛఏڙ͢Δ044 w %PDLFSpMFʹΑͬͯ%PDLFSΠϝʔδΛఆٛͰ͖Δ w Ϗϧυͨ͠%PDLFSΠϝʔδ%PDLFS3FHJTUSZͰެ։Ͱ͖ɺ ଞͷڥͰ͑ΔΑ͏ʹڞ༗Ͱ͖Δ What is Docker?
%PDLFSpMFΛॻ͍ͯɺ ΞϓϦέʔγϣϯΛ୭Ͱ͑ΔΑ͏ʹ͠Α͏ʂ
w ࠷͕ۙࣗॻ͍ͨ%PDLFSpMF w EPDLFSDPNQPTF w BQFY w NFDBC w +6."/
w FUDʜ Recently… %PDLFSΠϝʔδΛڞ༗͢Ε AEPDLFSSVOA͚ͩͰ.BDͰ8JOEPXTͰ-JOVYͰ ར༻Ͱ͖ΔΑ͏ʹʂ
#BE1SBDUJDF
Bad Practice to Write Dockerfile $ 5FSNJOBM
Bad Practice to Write Dockerfile $ vim Dockerfile 0QFOFEJUPS
Bad Practice to Write Dockerfile FROM alpine RUN apk add
—no-cache curl RUN command to take long time RUN some typo command 8SJUF%PDLFSpMF
Bad Practice to Write Dockerfile $ docker build . #VJME%PDLFSJNBHFBOEXBJUʜ
... (wait for 10 min)
Bad Practice to Write Dockerfile $ docker build . &SSPS
... ... /bin/sh: typo: not found The command '/bin/sh -c typo' returned a non-zero code: 127
None
Bad Iteration $ build ☕ 8SJUF #VJME8BJU &SSPS
#FTU1SBDUJDF
Best Practice to Write Dockerfile 5NVYɺ7JNɺ4MJNFΛͬͯ Ұߦͣͭ%PDLFSpMFΛ͔֬ΊΔ Ҏ্ɻ
%&.0
Best Practice to Write Dockerfile $ 3VOUNVYTQMJUQBOF $
Best Practice to Write Dockerfile $ vim Dockerfile $ docker
run -it alpine /bin/sh &EJU%PDLFSpMF 3VOCBTFJNBHF`TTIFMM
Best Practice to Write Dockerfile / # 8SJUFKVTUPOFMJOF FROM alpine
RUN apk add —no-cache curl 4IFMMJTSVOOJOH
Best Practice to Write Dockerfile / # apk add —no-cache
curl &YFDVUFPOFMJOFWJB4-*.& FROM alpine RUN apk add —no-cache curl
w ʮWJNTMJNFʯͱ͔ʮFNBDTTMJNFʯͰݕࡧʂ w ΤσΟλʔͷબ෦ΛɺUNVYͷผQBOFʹૹΓɺ ࣮ߦͰ͖ΔϓϥάΠϯ Slime? IUUQTHJUIVCDPNKQBMBSEZWJNTMJNF
Best Practice to Write Dockerfile / # apk add —no-cache
curl &YFDVUFPOFMJOFWJB4-*.& FROM alpine RUN apk add —no-cache curl
/ # some command Best Practice to Write Dockerfile /
# apk add —no-cache curl … &YFDVUFPOFMJOFWJB4-*.& FROM alpine RUN apk add —no-cache curl RUN some command
/ # some command … Best Practice to Write Dockerfile
/ # apk add —no-cache curl … &YFDVUFPOFMJOFWJB4-*.& FROM alpine RUN apk add —no-cache curl RUN some command RUN other command / # other command
Finally… $ docker build . 4BWFCVJMEJU $ ... ... Successfully
built
w UNVYͱWJNͱTMJNFΛ༻ҙ͢Δ w ҰߦͣͭTMJNFͰ࣮ߦ͔ͯ͠Βɺ࠷ޙʹAEPDLFSCVJMEA w λʔϛφϧʹ̍ߦͣͭίʔυΛૹΕΕԿͰྑ͍Αʂ ྫɿFNBDTTMJNFͱ͔JOUFMMJ+ͱ͔ Conclusion