SlideShare a Scribd company logo
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 1 / 9
Content
1 What is Dockerfile?
2 Dockerfile: Step by Step
3 Experience
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 2 / 9
What is Dockerfile?
• A Dockerfile is a text document that contains all the commands
you would normally execute manually in order to build a Docker
image.
• Docker can build images automatically by reading the instructions
from a Dockerfile.
• Dockerfile = Image Representations.
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 3 / 9
Dockerfile: Step by Step
1 v1: Basic command FROM, RUN, CMD
2 v2: Command COPY and EXPOSE
3 v3: Command VOLUME
4 v4: Final Dockerfile
Github: https://github.com/tranhuucuong91/tutorial-dockerfile.git
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 4 / 9
Experience: Caching everywhere
• Caching software packages and third-party source code.
• Dockerfile: có 1 phiên bản cho lab và 1 phiên cho product. Với phiên
bản cho lab, tối thiểu hóa “thời gian phải chờ”. Ví dụ: thời gian phải
chờ khi thực hiện update repo: apt-get update
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 5 / 9
Experience: Thin vs Flat
Đóng gói phần mềm: có 2 phong cách.
• Thin (like micro design): one process per container.
• Flat (like monolithic design): all-in-one, docker container like VM.
=> tùy trường hợp để sử dụng.
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 6 / 9
Experience: Base dựa trên image nào?
Cân bằng giữa tính tiện dụng và tính nhỏ gọn.
• Tiện dụng: dùng ubuntu, có nhiều phần mềm trong repo. Khi run
container, có thể execute vào container và có sẵn các phần mềm để
hỗ trợ việc xem thông tin, chỉnh sửa. Ví dụ: như vi editor.
• Nhỏ gọn: để có được tính nhỏ gọn, cần cắt giảm các gói phần mềm
không bắt buộc, làm giảm tính tiện dụng.
ubuntu 14.04 6d4946999d4f 188.3 MB
debian wheezy 1265e16d0c28 84.98 MB
alpine latest 31f630c65071 5.254 MB
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 7 / 9
References
1 https://blog.docker.com/2015/04/docker-tutorial-6-dockerfile-part-1/
2 https://docs.docker.com/reference/builder/
3 https://docs.docker.com/articles/dockerfile_best-practices/
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 8 / 9
Thank you!
• http://www.meetup.com/Docker-Hanoi/
• Trần Hữu Cường: tranhuucuong91@gmail.com
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 9 / 9

More Related Content

Similar to DockerDay2015: Introduction to Dockerfile

tài liệu Mã nguồn mở Lap trình tren linux
tài liệu Mã nguồn mở  Lap trình tren linuxtài liệu Mã nguồn mở  Lap trình tren linux
tài liệu Mã nguồn mở Lap trình tren linux
Thuyet Nguyen
 
Linux+03
Linux+03Linux+03
Linux+03
Duong Hieu
 
02 technical summary of linux distribution
02  technical summary of linux distribution02  technical summary of linux distribution
02 technical summary of linux distributionCơn Gió
 
Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)
Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)
Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)
Levis Nickaster
 
Subversion Seminar [2010]
Subversion Seminar [2010]Subversion Seminar [2010]
Subversion Seminar [2010]
Luân Võ Thành
 
Docker 101
Docker 101Docker 101
Docker 101
Lâm Đào
 
Ltgd ch01
Ltgd ch01Ltgd ch01
Ltgd ch01
neopet001
 
Lập trình Python GUI vs PySide
Lập trình Python GUI vs PySideLập trình Python GUI vs PySide
Lập trình Python GUI vs PySide
Chien Dang
 
ĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdf
ĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdfĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdf
ĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdf
Man_Ebook
 
Bat dau voi Raspberry Pi (demo)
Bat dau voi Raspberry Pi (demo)Bat dau voi Raspberry Pi (demo)
Bat dau voi Raspberry Pi (demo)
Thien Ta
 
Tuần 1+2 cài đặt kali linux
Tuần 1+2   cài đặt kali linuxTuần 1+2   cài đặt kali linux
Tuần 1+2 cài đặt kali linuxHường Tô
 
Sự khác nhau giữa phần mềm portable và installer
Sự khác nhau giữa phần mềm portable và installerSự khác nhau giữa phần mềm portable và installer
Sự khác nhau giữa phần mềm portable và installer
Đạt Ngô
 
Linux Network Administration (LPI-1,LPI-2)
Linux Network Administration (LPI-1,LPI-2)Linux Network Administration (LPI-1,LPI-2)
Linux Network Administration (LPI-1,LPI-2)
laonap166
 
Hướng dẫn cài đặt kali linux trên máy ảo vmware.docx
Hướng dẫn cài đặt kali linux trên máy ảo vmware.docxHướng dẫn cài đặt kali linux trên máy ảo vmware.docx
Hướng dẫn cài đặt kali linux trên máy ảo vmware.docx
Lê Lãnh
 
Hướng dẫn sử dụng hệ điều hành Ubuntu
Hướng dẫn sử dụng hệ điều hành UbuntuHướng dẫn sử dụng hệ điều hành Ubuntu
Hướng dẫn sử dụng hệ điều hành UbuntuQuang Ngoc
 
1. giới thiệu về ng￴n ngữ lập trình c#
1. giới thiệu về ng￴n ngữ lập trình c#1. giới thiệu về ng￴n ngữ lập trình c#
1. giới thiệu về ng￴n ngữ lập trình c#Duy Lê Văn
 
Báo cáo đề tài 5
Báo cáo đề tài 5Báo cáo đề tài 5
Báo cáo đề tài 5Nguyen Anh
 
Os lab2
Os lab2Os lab2
Os lab2
Dinh Lương
 

Similar to DockerDay2015: Introduction to Dockerfile (20)

tài liệu Mã nguồn mở Lap trình tren linux
tài liệu Mã nguồn mở  Lap trình tren linuxtài liệu Mã nguồn mở  Lap trình tren linux
tài liệu Mã nguồn mở Lap trình tren linux
 
Linux+03
Linux+03Linux+03
Linux+03
 
02 technical summary of linux distribution
02  technical summary of linux distribution02  technical summary of linux distribution
02 technical summary of linux distribution
 
Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)
Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)
Các công cụ cần thiết cho quá trình Reverse Engineering .NET (bản đầy đủ)
 
Subversion Seminar [2010]
Subversion Seminar [2010]Subversion Seminar [2010]
Subversion Seminar [2010]
 
Xoa mu linux
Xoa mu linuxXoa mu linux
Xoa mu linux
 
Docker 101
Docker 101Docker 101
Docker 101
 
Ltgd ch01
Ltgd ch01Ltgd ch01
Ltgd ch01
 
Lập trình Python GUI vs PySide
Lập trình Python GUI vs PySideLập trình Python GUI vs PySide
Lập trình Python GUI vs PySide
 
ĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdf
ĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdfĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdf
ĐỒ ÁN MÔN HỌC HỆ THỐNG NHÚNG MẠNG KHÔNG DÂY - Contiki OSreport.pdf
 
Bat dau voi Raspberry Pi (demo)
Bat dau voi Raspberry Pi (demo)Bat dau voi Raspberry Pi (demo)
Bat dau voi Raspberry Pi (demo)
 
Tuần 1+2 cài đặt kali linux
Tuần 1+2   cài đặt kali linuxTuần 1+2   cài đặt kali linux
Tuần 1+2 cài đặt kali linux
 
Sự khác nhau giữa phần mềm portable và installer
Sự khác nhau giữa phần mềm portable và installerSự khác nhau giữa phần mềm portable và installer
Sự khác nhau giữa phần mềm portable và installer
 
Linux Network Administration (LPI-1,LPI-2)
Linux Network Administration (LPI-1,LPI-2)Linux Network Administration (LPI-1,LPI-2)
Linux Network Administration (LPI-1,LPI-2)
 
Bai giangvb.net
Bai giangvb.netBai giangvb.net
Bai giangvb.net
 
Hướng dẫn cài đặt kali linux trên máy ảo vmware.docx
Hướng dẫn cài đặt kali linux trên máy ảo vmware.docxHướng dẫn cài đặt kali linux trên máy ảo vmware.docx
Hướng dẫn cài đặt kali linux trên máy ảo vmware.docx
 
Hướng dẫn sử dụng hệ điều hành Ubuntu
Hướng dẫn sử dụng hệ điều hành UbuntuHướng dẫn sử dụng hệ điều hành Ubuntu
Hướng dẫn sử dụng hệ điều hành Ubuntu
 
1. giới thiệu về ng￴n ngữ lập trình c#
1. giới thiệu về ng￴n ngữ lập trình c#1. giới thiệu về ng￴n ngữ lập trình c#
1. giới thiệu về ng￴n ngữ lập trình c#
 
Báo cáo đề tài 5
Báo cáo đề tài 5Báo cáo đề tài 5
Báo cáo đề tài 5
 
Os lab2
Os lab2Os lab2
Os lab2
 

More from Docker-Hanoi

ContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm Mode
ContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm ModeContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm Mode
ContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm Mode
Docker-Hanoi
 
ContainerDayVietnam2016: Become a Cloud-native Developer
ContainerDayVietnam2016: Become a Cloud-native DeveloperContainerDayVietnam2016: Become a Cloud-native Developer
ContainerDayVietnam2016: Become a Cloud-native Developer
Docker-Hanoi
 
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
Docker-Hanoi
 
ContainerDayVietnam2016: Docker for JS Developer
ContainerDayVietnam2016: Docker for JS DeveloperContainerDayVietnam2016: Docker for JS Developer
ContainerDayVietnam2016: Docker for JS Developer
Docker-Hanoi
 
ContainerDayVietnam2016: Containers with OpenStack
ContainerDayVietnam2016: Containers with OpenStackContainerDayVietnam2016: Containers with OpenStack
ContainerDayVietnam2016: Containers with OpenStack
Docker-Hanoi
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with Docker
Docker-Hanoi
 
ContainerDayVietnam2016: Docker at scale with Mesos
ContainerDayVietnam2016: Docker at scale with MesosContainerDayVietnam2016: Docker at scale with Mesos
ContainerDayVietnam2016: Docker at scale with Mesos
Docker-Hanoi
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
Docker-Hanoi
 
ContainerDayVietnam2016: Hybrid and Automation System Architecture
ContainerDayVietnam2016: Hybrid and Automation System ArchitectureContainerDayVietnam2016: Hybrid and Automation System Architecture
ContainerDayVietnam2016: Hybrid and Automation System Architecture
Docker-Hanoi
 
Azure Container Service
Azure Container ServiceAzure Container Service
Azure Container Service
Docker-Hanoi
 
Docker-Ha Noi- Year end 2015 party
Docker-Ha Noi- Year end 2015 partyDocker-Ha Noi- Year end 2015 party
Docker-Ha Noi- Year end 2015 party
Docker-Hanoi
 
DockerDay2015: Introduction to OpenStack Magnum
DockerDay2015: Introduction to OpenStack MagnumDockerDay2015: Introduction to OpenStack Magnum
DockerDay2015: Introduction to OpenStack Magnum
Docker-Hanoi
 
DockerDay2015: Keynote
DockerDay2015: KeynoteDockerDay2015: Keynote
DockerDay2015: Keynote
Docker-Hanoi
 
DockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM BluemixDockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM Bluemix
Docker-Hanoi
 
DockerDay2015: Docker Security
DockerDay2015: Docker SecurityDockerDay2015: Docker Security
DockerDay2015: Docker Security
Docker-Hanoi
 
DockerDay2015: Docker orchestration for developers
DockerDay2015: Docker orchestration for developersDockerDay2015: Docker orchestration for developers
DockerDay2015: Docker orchestration for developers
Docker-Hanoi
 
DockerDay2015: Docker Networking
DockerDay2015: Docker NetworkingDockerDay2015: Docker Networking
DockerDay2015: Docker Networking
Docker-Hanoi
 
DockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadminDockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadmin
Docker-Hanoi
 
DockerDay2015: Getting started with Google Container Engine
DockerDay2015: Getting started with Google Container EngineDockerDay2015: Getting started with Google Container Engine
DockerDay2015: Getting started with Google Container Engine
Docker-Hanoi
 
DockerDay2015: Getting started with Docker
DockerDay2015: Getting started with DockerDockerDay2015: Getting started with Docker
DockerDay2015: Getting started with Docker
Docker-Hanoi
 

More from Docker-Hanoi (20)

ContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm Mode
ContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm ModeContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm Mode
ContainerDayVietnam2016: Lesson Leanred on Docker 1.12 and Swarm Mode
 
ContainerDayVietnam2016: Become a Cloud-native Developer
ContainerDayVietnam2016: Become a Cloud-native DeveloperContainerDayVietnam2016: Become a Cloud-native Developer
ContainerDayVietnam2016: Become a Cloud-native Developer
 
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
 
ContainerDayVietnam2016: Docker for JS Developer
ContainerDayVietnam2016: Docker for JS DeveloperContainerDayVietnam2016: Docker for JS Developer
ContainerDayVietnam2016: Docker for JS Developer
 
ContainerDayVietnam2016: Containers with OpenStack
ContainerDayVietnam2016: Containers with OpenStackContainerDayVietnam2016: Containers with OpenStack
ContainerDayVietnam2016: Containers with OpenStack
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with Docker
 
ContainerDayVietnam2016: Docker at scale with Mesos
ContainerDayVietnam2016: Docker at scale with MesosContainerDayVietnam2016: Docker at scale with Mesos
ContainerDayVietnam2016: Docker at scale with Mesos
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
ContainerDayVietnam2016: Hybrid and Automation System Architecture
ContainerDayVietnam2016: Hybrid and Automation System ArchitectureContainerDayVietnam2016: Hybrid and Automation System Architecture
ContainerDayVietnam2016: Hybrid and Automation System Architecture
 
Azure Container Service
Azure Container ServiceAzure Container Service
Azure Container Service
 
Docker-Ha Noi- Year end 2015 party
Docker-Ha Noi- Year end 2015 partyDocker-Ha Noi- Year end 2015 party
Docker-Ha Noi- Year end 2015 party
 
DockerDay2015: Introduction to OpenStack Magnum
DockerDay2015: Introduction to OpenStack MagnumDockerDay2015: Introduction to OpenStack Magnum
DockerDay2015: Introduction to OpenStack Magnum
 
DockerDay2015: Keynote
DockerDay2015: KeynoteDockerDay2015: Keynote
DockerDay2015: Keynote
 
DockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM BluemixDockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM Bluemix
 
DockerDay2015: Docker Security
DockerDay2015: Docker SecurityDockerDay2015: Docker Security
DockerDay2015: Docker Security
 
DockerDay2015: Docker orchestration for developers
DockerDay2015: Docker orchestration for developersDockerDay2015: Docker orchestration for developers
DockerDay2015: Docker orchestration for developers
 
DockerDay2015: Docker Networking
DockerDay2015: Docker NetworkingDockerDay2015: Docker Networking
DockerDay2015: Docker Networking
 
DockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadminDockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadmin
 
DockerDay2015: Getting started with Google Container Engine
DockerDay2015: Getting started with Google Container EngineDockerDay2015: Getting started with Google Container Engine
DockerDay2015: Getting started with Google Container Engine
 
DockerDay2015: Getting started with Docker
DockerDay2015: Getting started with DockerDockerDay2015: Getting started with Docker
DockerDay2015: Getting started with Docker
 

DockerDay2015: Introduction to Dockerfile

  • 1. Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 1 / 9
  • 2. Content 1 What is Dockerfile? 2 Dockerfile: Step by Step 3 Experience Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 2 / 9
  • 3. What is Dockerfile? • A Dockerfile is a text document that contains all the commands you would normally execute manually in order to build a Docker image. • Docker can build images automatically by reading the instructions from a Dockerfile. • Dockerfile = Image Representations. Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 3 / 9
  • 4. Dockerfile: Step by Step 1 v1: Basic command FROM, RUN, CMD 2 v2: Command COPY and EXPOSE 3 v3: Command VOLUME 4 v4: Final Dockerfile Github: https://github.com/tranhuucuong91/tutorial-dockerfile.git Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 4 / 9
  • 5. Experience: Caching everywhere • Caching software packages and third-party source code. • Dockerfile: có 1 phiên bản cho lab và 1 phiên cho product. Với phiên bản cho lab, tối thiểu hóa “thời gian phải chờ”. Ví dụ: thời gian phải chờ khi thực hiện update repo: apt-get update Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 5 / 9
  • 6. Experience: Thin vs Flat Đóng gói phần mềm: có 2 phong cách. • Thin (like micro design): one process per container. • Flat (like monolithic design): all-in-one, docker container like VM. => tùy trường hợp để sử dụng. Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 6 / 9
  • 7. Experience: Base dựa trên image nào? Cân bằng giữa tính tiện dụng và tính nhỏ gọn. • Tiện dụng: dùng ubuntu, có nhiều phần mềm trong repo. Khi run container, có thể execute vào container và có sẵn các phần mềm để hỗ trợ việc xem thông tin, chỉnh sửa. Ví dụ: như vi editor. • Nhỏ gọn: để có được tính nhỏ gọn, cần cắt giảm các gói phần mềm không bắt buộc, làm giảm tính tiện dụng. ubuntu 14.04 6d4946999d4f 188.3 MB debian wheezy 1265e16d0c28 84.98 MB alpine latest 31f630c65071 5.254 MB Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 7 / 9
  • 8. References 1 https://blog.docker.com/2015/04/docker-tutorial-6-dockerfile-part-1/ 2 https://docs.docker.com/reference/builder/ 3 https://docs.docker.com/articles/dockerfile_best-practices/ Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 8 / 9
  • 9. Thank you! • http://www.meetup.com/Docker-Hanoi/ • Trần Hữu Cường: tranhuucuong91@gmail.com Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 9 / 9