7. • docker is an open-source engine that
automates the deployment of any
application as a lightweight, portable, self-
sufficient container that will run virtually
anywhere.
8. docker
• dotCloud 내부 프로젝트로 시작 (2013.01)
• python - go
• dotcloud, Inc. - docker, Inc
• $15M series Funding
• v0.8 - new architecture
• v0.9 - libcontainer
38. • docker is an open-source engine that
automates the deployment of any
application as a lightweight, portable, self-
sufficient that will run virtually
anywhere.
39. • docker is an open-source engine that
automates the deployment of any
application as a lightweight, portable, self-
sufficient that will run virtually
anywhere.
container
41. docker에서 사용된 기술들
• LinuX Container ( LXC )
• namespaces
• cgroups
• layered file system
42. Linux containers?
lightweight vm
• own process space
• own network interface
• can run stuff as root
• can have its own /sbin/init
( different from the host )
43. Linux containers?
a chroot on steroids
• can also not have its own /sbin/init
• container = isolated process(es)
• share kernel with host
• no device emulation
( neither HVM nor PV )
44. containers vsVMs
( Hypervisor Type2 )
• VM runs on(above) the host operating
system as a full fledged OS and uses
isolated process spaces.
• Docker runs with host operating system as
its share the host process spaces.
58. vagrant vs docker
47
Feature vagrant docker
virtualization
type
VM ( virtual machine ) VE ( virtual environment )
guaranteed
resources at
hardware level?
Yes No
Supported
platforms
Linux, Unix,Windows
Linux,
OS x - Windows
( using virtual machine )
boot time a few minutes a few second
config file Vagrantfile Dockerfile
59. vagrant vs docker
• vagrant는Virtual Machine 를 관리하기 위한
용도로 사용한다. ( on host )
• docker는Virtual Environment를 관리하기 위
한 용도로 사용한다. ( with host )
48
60. vagrant vs docker
• vagrant는Virtual Machine 를 관리하기 위한
용도로 사용한다. ( on host )
• docker는Virtual Environment를 관리하기 위
한 용도로 사용한다. ( with host )
48
61. VM vs container
• 서로 상호 보완 관계
• VM은 하드웨어 리소스의 chunk를 할당하는
데 가장 유용합니다.
• container는 소프트웨어 전달 단위로서 매우
가볍고 완벽하게 프로세스 수준에서 작동합니
다.
49
62. apache in ubuntu 12.04
vagrant
• ubuntu 12.04 이미지를 다운로드 (vagrant init )
• vm 실행 (vagrant up)
• vagrant ssh 접속
• apt-get 으로 apache2 설치
• port forward 설정
• apache start
50
63. apache in ubuntu 12.04
docker
• ubuntu 12.04 다운로드 ( docker pull
ubuntu )
• container 접속 : docker run -i -t ubuntu:
12.04 /bin/bash
• apt-get 으로 apache 설치
• docker 이미지 생성 ( docker commit )
• docker 실행 ( docker run -d )
51
75. mysql - Dockerfile
• FROM ubuntu:saucy
• MAINTAINER Fernando Mayo
fernando@tutum.co
!
• # Install packages
• RUN apt-get update
• RUN DEBIAN_FRONTEND=noninteractive apt-
get -y install supervisor mysql-server pwgen
63
77. 유의사항 및 특징
• foreground 로 실행되도록 daemon을 설정해주어야 한다.
( mysqld_safe, apache2ctl -D FORGROUND )
• hosts 파일은 아직 수정이 불가능하다.
(https://github.com/dotcloud/docker/issues/3851)
• host의 디렉토리를 마운트 하는 경우 Dockerfile로 만들
수 없다.
• 쉘 접속이 기본적이지 않아 설정을 수정하는데 번거롭다.
• 다중 daemon을 실행하려면 우회적인 방법을 사용해야 한
다.
65