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
Introduction to Docker
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Manatsawin Hanmongkolchai
March 08, 2018
Programming
1
210
Introduction to Docker
Manatsawin Hanmongkolchai
March 08, 2018
Tweet
Share
More Decks by Manatsawin Hanmongkolchai
See All by Manatsawin Hanmongkolchai
Nix: Declarative OS
whs
0
100
gRPC load balancing with xDS
whs
0
1k
ArgoCD
whs
0
460
Writing Babel Plugin
whs
0
220
What's new in Cloud Next 2019
whs
0
320
A Date with gRPC
whs
1
1.5k
ตีแผ่ Microservice ด้วย Tracing
whs
0
400
Next Generation Smart Home
whs
0
1k
Istio and the Service Mesh Architecture
whs
3
1.1k
Other Decks in Programming
See All in Programming
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
190
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
490
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
470
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1k
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
500
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
180
Raku Raku Notion 20260128
hareyakayuruyaka
0
420
AI活用のコスパを最大化する方法
ochtum
0
120
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
190
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
200
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
780
atmaCup #23でAIコーディングを活用した話
ml_bear
4
710
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
WCS-LA-2024
lcolladotor
0
470
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
90
Skip the Path - Find Your Career Trail
mkilby
0
70
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
300
Amusing Abliteration
ianozsvald
0
120
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
300
AI: The stuff that nobody shows you
jnunemaker
PRO
3
340
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
180
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
330
Transcript
Introduction to Docker
Me • มนัสวิน หาญมงคลชัย • SKE11 • Junior Architect at
Wongnai • Wongnai is Hiring! https://careers.wongnai.com (Internship/Full time)
Review pls
Today's Agenda • ทําไม Docker ถึงเปนที่นิยม • การติดตั้งโปรแกรมจาก Docker Hub
• การสราง Docker Image จากโปรแกรมของตัวเอง • การใชงาน Docker Compose
Why Docker?
Web A Why Docker Web B 4 5
Why Docker Host OS VM A VM B 4 5
Why Docker Host OS VM A VM B 4 5
Why Docker VM A 4 Docker Hub hub.docker.com
Why Docker - for application developer • ควบคุม environment ไดเกือบ
100% • ไมมีโปรแกรม/library ที่ไมเกี่ยวของ/ผิดเวอรชั่นลงอยู • ทําซํ้าได
Running application from Docker Hub
None
Running application from Docker Hub Linux: http://172.17.0.2:2368 Windows/Mac: หา IP
จากใน Docker for Mac/Windows
Running application from Docker Hub ถาใช Docker บนระบบที่ไมใช Linux ตัว
Docker จะรันอยูบน VM ที่รัน Linux เวลาจะเขาตองเปด port เสมอ $ docker run -p 80:2368ghost (แปลวาให Port 80 ตรงกับ port 2368 ภายใน Image) เสร็จแลวเขาที่ http://localhost
Making your own image ดาวนโหลดแอพที่ https://github.com/whs/docker-course-2018 ลองรันในเครื่องดู $ npm i
$ node . ถาทําเสร็จแลว ลองแกะโคดอานดูกอน
Writing Dockerfile ไดเวลาเขียน Dockerfile!
Build & Run $ docker build -t imagename . $
docker run --init -p 80:3000 imagename
Run with environment ในโคดจะมีการอาน process.env.TEXT เพื่อใหเราสามารถกําหนดตัวแปรขณะรันได $ docker run --init
-p 80:3000 -e "TEXT=Hello Docker" imagename
Docker Compose ในโปรแกรมจริง ลงแค Node.js อยางเดียวไมพอ อาจจะตองมี MySQL, Redis, ฯลฯ
เพิ่ม ไปอีกดวย แต Docker ใหรันไดเพียงโปรแกรมเดียว จึงมีโปรแกรม Docker Compose เขามากําหนดการวาง container หลายๆ ตัว
Docker Compose เขียน compose กัน!
Docker Compose $ docker-compose up -d $ docker-compose down
Next step • Docker Compose นั้นนิยมใชกับระบบขนาดเล็กในเครื่องเดียว • สําหรับระบบ server ที่มีเครื่องจํานวนมากจะใช
Kubernetes ซึ่งจะมีการจัดสรร ทรัพยากรใหดวย • To be continued