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
Docker ไงจะใครล่ะ
Search
Manatsawin Hanmongkolchai
August 31, 2016
Programming
180
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Docker ไงจะใครล่ะ
CPE Mini Conference 2016
Manatsawin Hanmongkolchai
August 31, 2016
More Decks by Manatsawin Hanmongkolchai
See All by Manatsawin Hanmongkolchai
Nix: Declarative OS
whs
0
140
gRPC load balancing with xDS
whs
0
1.1k
ArgoCD
whs
0
490
Writing Babel Plugin
whs
0
240
What's new in Cloud Next 2019
whs
0
330
A Date with gRPC
whs
1
1.5k
ตีแผ่ Microservice ด้วย Tracing
whs
0
420
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
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.3k
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
380
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
390
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
110
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
190
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
550
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
490
今さら聞けない .NET CLI
htkym
0
190
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
250
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
640
Featured
See All Featured
Paper Plane
katiecoart
PRO
2
53k
How to build a perfect <img>
jonoalderson
1
5.9k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
640
Into the Great Unknown - MozCon
thekraken
41
2.7k
Speed Design
sergeychernyshev
33
2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
200
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Ruling the World: When Life Gets Gamed
codingconduct
0
290
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
520
So, you think you're a good person
axbom
PRO
2
2.1k
Documentation Writing (for coders)
carmenintech
77
5.4k
Transcript
Docker ไงจะใครละ
Me • SKE ป 4 • Intern @ Wongnai (วงในก็ใช
Docker นะ!) • whs.in.th •
[email protected]
(เพิ่งเซตเมลใหมดวย Docker ขอเหอหนอย)
Docker คือ…?
App Library Configuration Docker image
Linux Docker Linux VirtualBox App Library Configuration Container App Library
Configuration Container App Linux Configuration Virtual machine Library App Linux Configuration Virtual machine Library * วาดแบบหยาบๆ
Linux Docker Linux VirtualBox App Library Configuration Container App Shared
Library Configuration Container App Linux Configuration Virtual machine Library App Linux Configuration Virtual machine Library * วาดแบบหยาบๆ Library
"จับโปรแกรมใสถัง พลังสูง"
ใช Docker ทําไม ..?
ลงโปรแกรมงาย
None
sudo apt-get install php5-cli php5-mysqlnd php5-fpm nginx beanstalkd supervisor ลง
Web server
curl -sS https://getcomposer.org/instal ler | php sudo mv composer.phar /usr/local/bin/composer
ลง composer
sudo mkdir /var/www/ /var/grader/ sudo chown www-data:www-data /var/www sudo cp
-r assets server templates index.html /var/www/ sudo cp -r vm/graderclient/ /var/grader/ ลง grader web
sudo cp vagrant/nginx.conf /etc/nginx/sites-available/def ault sudo service nginx restart เซต
web server นี่คือกอปไฟลสําเร็จมาแลวดวยนะ ไมไดเซตเอง
ฯลฯ ขี้เกียจทําสไลด
sudo docker-compose up
Dockerfile FROM django:1.9-python3 ADD https://github.com/just-containers/s6-overlay/releases/download/v1.18.1.3/s6-overlay-amd64.tar.gz /tmp/ ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /usr/bin/ ENTRYPOINT
["/init"] EXPOSE 80 RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \ rm /tmp/s6-overlay-amd64.tar.gz && chmod +x /usr/bin/wait-for-it.sh RUN apt-get update && apt-get install -y pwgen nginx-light libffi-dev && \ rm -rf /var/lib/apt/lists/* && \ rm /var/www/htdocs/* || true RUN pip3 install gunicorn dj_database_url && \ useradd -d /grader -MN -s /bin/false grader && \ mkdir -p /data/media && chown -R grader /data COPY . /grader RUN cd /grader/docker && tar -c * | tar -C /etc -x && cd /grader && rm -r /grader/docker/ && \ pip3 install -r requirements.txt && \ echo "STATIC_ROOT = '/var/www/htdocs/'" > /grader/grader/local_settings.py && \ python3 manage.py collectstatic -l --no-input
ทําซํ้าได
หมดปญหา runtime ไมตรงกัน ตองใช nginx 1.10 ขึ้นไปนะ PHP 7 ยังไมรองรับ
ตองใช Node 6 Java 6 เกาไป
หมดปญหา runtime ตีกัน
หมดปญหา "It work on my machine" ¯\_(ツ)_/¯
ใชยังไง?
docker.com
ใชไดกับ Linux ชื่อดังทุกเจา
https://blog.whs.in.th/node/2283
Best seller https://blog.whs.in.th/node/2283
Orchestration
None
* Docker Swarm ลงงาย มี WebUI ดวย "Planet scale" by
Google ลงงายกวา พังงายดวย Classic
console.cloud.google.com * เสียเงิน
ขอบคุณครับ XD สไลด → speakerdeck.com/whs