Hello Docker! 🙋‍♂️

19. 08. 17

이장희

Context

  • What is the Docker?
  • Docker
  • Why use the Docker?
  • 참고자료

What is the Docker?

What is the Docker?

도커는 솔로몬 하익스(Solomon Hykes) 씨가
2013년 파이콘 라이트닝 토크에서 발표한
The future of Linux Containers 에서
최초로 소개 되었습니다.

What is the Docker?

Docker is a platform for developers and sysadmins to develop, deploy,
and run
 applications with containers.
The use of Linux containers to deploy applications is called
containerization.
Containers are not new, but their use for easily deploying applications is.

What is the Docker?

What is the Docker?

도커란 컨테이너형 가상화 라고 불리는 기술을 통해서
환경에 구애 받지 않고 애플리케이션을 배포하는데 특화 된 플랫폼

What is the Docker?

Image & Container

What is the Docker?

  • Image : 이미지는 컨테이너를 생성 시키기 위한 도구입니다.
    예를 들자면, CD 를 생각할 수 있습니다. 우리가 애플리케이션을 실행 시키는데 필요한 모든 정보가 들어가 있습니다.
     
  • Containers :  컨테이너는 이미지가 실행되어 생긴 인스턴스라고 말할 수 있습니다. 컨테이너는 1개의 프로세스로써 메모리에 올라가 실행되는 이미지의 결과물 입니다. 

What is the Docker?

What is the Docker?

Docker Architecture

What is the Docker?

What is the Docker?

도커의 구성요소

  • Docker Client

  • Docker Objects

  • Docker Daemon

  • Docker Registry

What is the Docker?

Docker Client사용자와 컨테이너간의 대화 수단입니다.

사용자가 입력한 모든 도커 커맨드를 뜻합니다.

What is the Docker?

What is the Docker?

Docker Object는 도커에서 중요한 컴포넌트인 컨테이너이미지를 뜻합니다.
 

컨테이너는 이미지의 인스턴스 이며, 이것은 읽고 쓰는 작업이 가능합니다.

이미지는 오직 읽기 만이 가능하며 새로운 컨테이너를 만드는데 사용됩니다.

What is the Docker?

What is the Docker?

Docker Daemon 은 도커 클라이언트에서 들어오는 명령을 응답하기 위해 실행되는 백그라운드 프로세스입니다.  흔히 도커 서버라고도 불리며,
CLI를 통해 들어오는 명령을 컨테이너에게 전달합니다.

What is the Docker?

What is the Docker?

Docker Registry 는 보통, 도커 허브(Docker Hub)라고도 불리며,
사용자가 생성한
 이미지를 저장하고 받을 수 있는 원격 저장소 입니다.

What is the Docker?

What is the Docker?

What is the Docker?

Container and Virtual Machines

What is the Docker?

VM과 컨테이너는 호스트 환경과 다른 환경을 제공하는 목적을 지닌다.
그럼 이 둘은 뭐가 다른걸까?

What is the Docker?

VM의 경우

  • 소프트웨어를 가지고 하드웨어를 구현하는 일을 한다.
  • 사용자의 컴퓨터 위에 소프트웨어로 구현된 컴퓨터가 만들어지는 것

What is the Docker?

Container의 경우

  • 하드웨어 가상화가 포함되어 있지 않다. 
  • 컨테이너는 리눅스 커널에서 돌아가는 1개의 격리된 프로세스 이다.

What is the Docker?

Docker

Why use the Docker?

Why use the Docker?

Application Deploy

Why use the Docker?

Spring Application Deploy

  1. 서버 운영체제 설치
  2. 서버에 필요한 환경 설정 및
    필수 소프트웨어 설치
  3. 웹 서버 설치
  4. 웹 서버 내에서 Maven 빌드
  5. 데이터 베이스 설정
  6. 등등등

Why use the Docker?

Why use the Docker?

Why use the Docker?

개발 서버를 다시 구성할려니 처음 구성했던 운영체제부터 컴파일러, 설치된 패키지까지 완벽하게 똑같이 설치 할려니 기억이 잘 안남..

Why use the Docker?

좀 더 현실적인 예제를 들어보자.

Why use the Docker?

Snowflake Server 

Why use the Docker?

A Server

Install
ImageMagick

 Server에 Image Magick 이라는 도구를 설치한다고 가정해보자.

B Server

Install

ImageMagick

1 달전

오늘

애플리케이션 배포

Why use the Docker?

A 서버에 장애 발생!!!

Why use the Docker?

Why use the Docker?

생각할 수 있는 장애 원인들

  • 웹 서비스에서 이미지매직 최신 버전에 새로 추가된 기능을 사용했다.
  • 웹 서비스의 업데이트 부분 코드에 버그가 있다.
  • 이미지 매직의 버전이 다르다.
  • 이미지 매직이 의존하는 라이브러리의 버전이 다르다.

Why use the Docker?

Why use the Docker?

예제에서는 1달을 기준으로 삼았지만 기간이 더 늘어날 수 있습니다.

 처음엔 각 서버 사이의 차이점이 눈송이 하나 만큼 작을지 모르지만, 서버를 오래 운영하다보면 점점 커져서 나중엔 집을 삼키는
거대한 눈덩이가 되어 있을 겁니다.

Why use the Docker?

Why use the Docker?

Why use the Docker?

Docker를 써야하는 이유

Why use the Docker?

서버를 코드로 구성하고 관리 할 수 있다.

Why use the Docker?

물론 도커를 사용하지 않고도 서버 운영 기록을 저장할 수 있습니다. 

Why use the Docker?

Why use the Docker?

Dockerfile 역시 서버 운영 기록을 코드화 한 것입니다. 

Why use the Docker?

이렇게 만들어진 도커 이미지는 운영 기록을 실행 할 시점
이라 할 수 있습니다.

Why use the Docker?

  • 도커 파일 : 서버 운영 기록 코드화
  • 도커 이미지 : 도커 파일 + 실행 시점

Why use the Docker?

Why use the Docker?

참고 자료

Hello Docker

By yesdoing

Hello Docker

Docker 알쓸신잡

  • 245