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
Manatsawin Hanmongkolchai
March 08, 2018
Programming
1
190
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
77
gRPC load balancing with xDS
whs
0
940
ArgoCD
whs
0
420
Writing Babel Plugin
whs
0
180
What's new in Cloud Next 2019
whs
0
290
A Date with gRPC
whs
1
1.4k
ตีแผ่ Microservice ด้วย Tracing
whs
0
360
Next Generation Smart Home
whs
0
960
Istio and the Service Mesh Architecture
whs
3
1k
Other Decks in Programming
See All in Programming
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
650
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
220
Deep Dive into ~/.claude/projects
hiragram
14
2.6k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
1k
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
170
Porting a visionOS App to Android XR
akkeylab
0
470
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
250
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
1
10k
ふつうの技術スタックでアート作品を作ってみる
akira888
1
860
Node-RED を(HTTP で)つなげる MCP サーバーを作ってみた
highu
0
120
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
87
29k
システム成長を止めない!本番無停止テーブル移行の全貌
sakawe_ee
1
200
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Six Lessons from altMBA
skipperchong
28
3.9k
Building an army of robots
kneath
306
45k
Done Done
chrislema
184
16k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
RailsConf 2023
tenderlove
30
1.1k
GraphQLとの向き合い方2022年版
quramy
49
14k
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