7. • docker is an open-source engine that
automates the deployment of any
application as a lightweight, portable, selfsufficient container that will run virtually
anywhere.
6
13년 10월 15일 화요일
8. • docker는 거의 어디에서나 실행되는 경량이
면서 portable하고, 자급자족인 컨테이너 응용
프로그램의 배포를 자동화하는 오픈소스 엔진
입니다.
7
13년 10월 15일 화요일
9. • docker는 거의 어디에서나 실행되는 경량이
면서 portable하고, 자급자족인 컨테이너 응용
프로그램의 배포를 자동화하는 오픈소스 엔진
입니다.
??
at
wh
7
13년 10월 15일 화요일
14. docker
• dotCloud 내부 프로젝트로 시작 (2013.01)
• python -> go
• docker는 현재 다음 기술들로 구현됨
LinuX Containers
Control Groups & Namespaces
AUFS
12
13년 10월 15일 화요일
15. • like git
vagrant@precise64:~$ sudo docker pull centos:6.4
Pulling repository centos
539c0211cd76: Downloading 61.8 MB/98.56 MB (63%)
~/workspace/usergrid-stack-origin:~$ git pull origin master
remote: Counting objects: 291, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 210 (delta 79), reused 170 (delta 42)
Receiving objects: 100% (210/210), 48.34 KiB, done.
Resolving deltas: 100% (79/79), completed with 38 local
objects.
From github.com:apigee/usergrid-stack
13
13년 10월 15일 화요일
16. • like git
sudo docker pull centos:6.4
vagrant@precise64:~$
Pulling repository centos
539c0211cd76: Downloading
61.8 MB/98.56 MB (63%)
~/workspace/usergrid-stack-origin:~$ git pull origin master
remote: Counting objects: 291, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 210 (delta 79), reused 170 (delta 42)
Receiving objects: 100% (210/210), 48.34 KiB, done.
Resolving deltas: 100% (79/79), completed with 38 local
objects.
From github.com:apigee/usergrid-stack
13
13년 10월 15일 화요일
17. •
sudo docker pull centos:6.4
like git
git pull origin master
vagrant@precise64:~$
Pulling repository centos
539c0211cd76: Downloading
61.8 MB/98.56 MB (63%)
~/workspace/usergrid-stack-origin:~$
remote: Counting objects: 291, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 210 (delta 79), reused 170 (delta 42)
Receiving objects: 100% (210/210), 48.34 KiB, done.
Resolving deltas: 100% (79/79), completed with 38 local
objects.
From github.com:apigee/usergrid-stack
13
13년 10월 15일 화요일
18. • about docker
why docker
• inside docker
• demo
• docker use cases
• limitations
• epilogue
13년 10월 15일 화요일
42. Linux containers
•
•
13년 10월 15일 화요일
run everywhere
•
•
커널 버전과 관계없이
Host 배포판과 관계없이
run anything
•
•
Host에서 동작한다면 container에서도 동작한다.
즉, 리눅스 커널에서 동작한다면 가능하다.
44. • docker is an open-source engine that
automates the deployment of any
application as a lightweight, portable, selfsufficient
that will run virtually
anywhere.
13년 10월 15일 화요일
45. • docker is an open-source engine that
automates the deployment of any
application as a lightweight, portable, selfsufficient container that will run virtually
anywhere.
13년 10월 15일 화요일
46. • about docker
• why docker
inside docker
• demo
• docker use cases
• limitations
• epilogue
13년 10월 15일 화요일
47. Linux containers란 무엇인가?
• own process space
• own network interface
• can run stuff as root
• can have its own /sbin/init
(different from the host)
13년 10월 15일 화요일
48. Linux containers란 무엇인가?
그것은 경량화된 VM이다.
• own process space
• own network interface
• can run stuff as root
• can have its own /sbin/init
(different from the host)
13년 10월 15일 화요일
49. Linux containers란 무엇인가?
그것은 경량화된 VM이다.
• own process space
• own network interface
• can run stuff as root
• can have its own /sbin/init
(different from the host)
[Machine Container]
13년 10월 15일 화요일
50. Linux containers란 무엇인가?
• can also not have its own /sbin/init
• container = isolated process(es)
• share kernel with host
• no device emulation
(neither HVM nor PV)
13년 10월 15일 화요일
51. Linux containers란 무엇인가?
스팀팩 맞은 chroot
• can also not have its own /sbin/init
• container = isolated process(es)
• share kernel with host
• no device emulation
(neither HVM nor PV)
13년 10월 15일 화요일
52. Linux containers란 무엇인가?
스팀팩 맞은 chroot
• can also not have its own /sbin/init
• container = isolated process(es)
• share kernel with host
• no device emulation
(neither HVM nor PV)
[Application Container]
13년 10월 15일 화요일
53. containers vs VMs ( Hypervisor Type2 )
• VM runs on(above) the host operating
system as a full fledged OS and uses
isolated process spaces.
( virtualbox,VMware, Parallels Desktop ... )
• Docker runs with host operating system
as its share the host process spaces.
13년 10월 15일 화요일
54. containers이어야 하는 이유
• speed : boots in seconds
• footprint : 100-1,000 containers on one machine.
13년 10월 15일 화요일
60. LinuX Container ( LXC )
•
•
•
•
•
또 다른 리눅스 시스템에서 리눅스 시스템을 구동
container는 리눅스 박스내의 process 그룹
container 안에서는 VM처럼 보임
container 밖에서는 process 처럼 보임
스팀팩 맞은 chroot
46
13년 10월 15일 화요일
68. AUFS ( Advanced multi layered
Unification FileSystem )
•
•
layered 파일 시스템
•
rootfs(루트파일시스템)에 있는 내용을 수정할 수 있
으나, 수정한 내용은 rw 디렉토리로 이동된다.
최상위 layer만 읽기 쓰기가 가능한 layer로 설정되어
있음 ( container )
50
13년 10월 15일 화요일
72. rootfs
• 일반적인 디렉토리를 포함한다.
( /dev, /bin, /etc )
• 환경설정 및 실행파일 그리고 라이브러리파일
들이 rootfs에 있다.
( like bash, ls ... )
54
13년 10월 15일 화요일
73. Layer
- 전통적인 linux 부팅 순서
. rootfs를 읽기 전용으로 마운트
. rootfs 무결성 검사
. rootfs를 읽기쓰기 모드로 변경
- docker 는 오직 rootfs를 읽기 전용으
로 마운트 한다. 대신 읽기쓰기가 가능한
레이어를 추가한다. ( it's
)
55
13년 10월 15일 화요일
74. Layer
- 전통적인 linux 부팅 순서
. rootfs를 읽기 전용으로 마운트
. rootfs 무결성 검사
. rootfs를 읽기쓰기 모드로 변경
- docker 는 오직 rootfs를 읽기 전용으
로 마운트 한다. 대신 읽기쓰기가 가능한
레이어를 추가한다. ( it's container )
55
13년 10월 15일 화요일
75. Image
- 읽기 전용 레이어 image로 부름
- image는 상태를 가질 수 없음
- 부모 image가 없는 image를 base
image라고 함 ( e.g. Debian )
56
13년 10월 15일 화요일
76. Container
- 읽기쓰기가 가능한 레이어
- 최상위 레이어
- 상태를 가질 수 있음
- container를 docker의 commit 명령어
를 통해 이미지로 만들수도 있으며 만든
이미지를 다시 parent image로 사용할 수
있음. 즉 재사용할 수 있음.
57
13년 10월 15일 화요일
78. Union file system
•
일반적으로 리눅스에서는 디렉토리 하나에 하나의 파일시스
템만 마운트하는게 대부분.
•
만일 동일한 디렉토리에 둘 이상의 파일 시스템을 마운트하
면 항상 마지막에 마운트한 파일 시스템 내용만 보여 이전에
마운트한 파일 시스템 내용은 접근이 불가능.
•
병합(union)마운트란 하나의 디렉토리에 여러 파일시스템을
마운트 하여 여러 파일 시스템 내용이 합쳐지는 것을 의미.
•
나중 마운트한 파일이 우선시 됨. 만일 writable mount가 되
었다면 마운트 파일을 지웠을때, 그 정보도 유지됨.
59
13년 10월 15일 화요일
79. Demo union file system
in docker
http://youtu.be/uHLs5ljV20U
60
13년 10월 15일 화요일
91. •
•
프로세스들은 고립되어 있지만, host위에서 직접 실행된다.
CPU performance
•
memory performance
•
native performance ( 거의 차이 없음 )
a few % shaved off for (optional) accounting
network performance
-
작은(small)의 오버헤드 발생. ( docker project 팀은 향후
에 충분히 1:1에 가까운 수준으로 최적화 가능하다라고 함 )
69
13년 10월 15일 화요일
105. • about docker
• why docker
• inside docker
• demo
docker use cases
• limitations
• epilogue
13년 10월 15일 화요일
106. •
•
•
•
•
•
•
•
•
testing
build your own PaaS
web based environment for instruction
easy application deployment
create secure sandboxes
create your own SaaS
automated application deployment
continuous integration and deployment : travis
lightweight desktop virtualization
80
13년 10월 15일 화요일
108. 유닛 테스팅
• 자신의 환경과 테스트를 분리하기 위해 컨테
이너를 사용
• 테스트후에 data등을 정리 하기 위해 더이상
신경쓰지 않아도 됨
• 다중 머신에 걸친 테스트도 문제 없음
82
13년 10월 15일 화요일
109. 시스템 테스팅
• 쉽게 테스트와 다른 시스템 환경설정을 만들
수 있음
• 테스트서버가 끊기거나 재구축에 대해서 더이
상 걱정할 필요 없음
• 사용예 : Test Fabric script
(http://agiliq.com/blog/2013/06/self-testing-fabfile-using-docker/)
83
13년 10월 15일 화요일
110. Continuous integration
•
•
•
개별 소스 커밋에 대해서 유닛 테스트를 할 수 있음
StriderCD.com - Open source CI server
•
deploy전에 docker 컨테이너를 통해 CI test를
수행
TravisCI docker를 활용하고 있음
84
13년 10월 15일 화요일
111. Continuous integration
•
•
•
개별 소스 커밋에 대해서 유닛 테스트를 할 수 있음
StriderCD.com - Open source CI server
•
deploy전에 docker 컨테이너를 통해 CI test를
수행
TravisCI docker를 활용하고 있음
84
13년 10월 15일 화요일
158. • about docker
• why docker
• inside docker
• demo
• docker use cases
• limitations
epilogue
13년 10월 15일 화요일
159. docker 로드맵
• 2013-08-08 - 새로운 아키텍쳐 계획 발표
• 2013-08 mid - 0.6 릴리즈
• 2013-10 - 0.8 릴리즈 ( 새로운 아키텍쳐 )
• 2013-10 ~ 11 0.8 certified on RHEL,
CentOS
(http://blog.docker.io/2013/09/red-hat-anddocker-collaborate/)
13년 10월 15일 화요일
160. • docker is an open-source engine that
automates the deployment of any
application as a lightweight, portable, selfsufficient container that will run virtually
anywhere*.
13년 10월 15일 화요일
162. docker v1.0
•
•
•
13년 10월 15일 화요일
Stabilizing
•
•
Shrink and stabilize Core
Provide stable, pluggable API
Expanding runtime environments
•
•
•
•
•
OpenStack : announced
Docker as various flavors of VM ( AMI, vdf, etc )
Increase compatible kernel set
Increase compatible Union FS set
IaaS compatibility
Dev/devops tools integrations
•
•
Chef, Puppet,Vagrant, Github, Travis, Buildbot
Various flavors of PaaS & IDE
163. similar to docker
( lem-kut-fee )
https://github.com/google/lmctfy
since 2013.10.02
13년 10월 15일 화요일