DockerDay2015: Introduction to Dockerfile
-
Upload
docker-hanoi -
Category
Technology
-
view
24 -
download
1
Transcript of DockerDay2015: Introduction to Dockerfile
![Page 1: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/1.jpg)
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 1 / 9
![Page 2: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/2.jpg)
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
![Page 3: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/3.jpg)
What is Dockerfile?
• A Dockerfile is a text document that contains all the commandsyou would normally execute manually in order to build a Dockerimage.
• Docker can build images automatically by reading the instructionsfrom a Dockerfile.
• Dockerfile = Image Representations.
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 3 / 9
![Page 4: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/4.jpg)
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
![Page 5: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/5.jpg)
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ênbản cho lab, tối thiểu hóa “thời gian phải chờ”. Ví dụ: thời gian phảichờ 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
![Page 6: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/6.jpg)
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
![Page 7: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/7.jpg)
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 runcontainer, 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ềmkhông bắt buộc, làm giảm tính tiện dụng.
ubuntu 14.04 6d4946999d4f 188.3 MBdebian wheezy 1265e16d0c28 84.98 MBalpine latest 31f630c65071 5.254 MB
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 7 / 9
![Page 8: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/8.jpg)
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
![Page 9: DockerDay2015: Introduction to Dockerfile](https://reader036.fdocuments.in/reader036/viewer/2022071804/55d1552dbb61eb11778b475b/html5/thumbnails/9.jpg)
Thank you!• http://www.meetup.com/Docker-Hanoi/
• Trần Hữu Cường: [email protected]
Trần Hữu Cường (OLBIUS Vietnam) Introduction to Dockerfile Hà Nội, 19/07/2015 9 / 9