Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Docker Intro

205 views

Published on

Docker introduction

Published in: Software
  • Be the first to comment

  • Be the first to like this

Docker Intro

  1. 1. Docker https://www.docker.com/
  2. 2. 기존소프트웨어배포방식, 인프라의문제점 배포환경마다설치된커널버전, 설치된라이브러리등상이함 서버를중단시켜수정된버전으로올려서다시빌드 개발자들의전통적인변명"내컴퓨터에서는잘돌아가는데?" 서버환경이늘어나는경우, 일일이설치해주는것도힘듬
  3. 3. Docker? 도커란, 오픈소스컨테이너이다. 기존의가상머신과 비슷하면서도훨씬가벼운형태 Docker‑Machine, Docker‑Compose Docker Toolbox, Boot2Docker DockerHub, Docker‑Registry Docker Swarm
  4. 4. Docker vs VirtualMachine 리눅스커널의cgroups, namespaces를사용해가상공간을생성
  5. 5. Container 가상머신을사용하게 되면상세설정을해주지않는한메모리, CPU 코 어, 프로세스등각종성능손실이발생 컨테이너는Host OS의커널은그대로사용하고 일부분만패키징되기 때문에용량이크게 줄어들뿐만아니라, 프로세스영역도기존의OS와 공유해서사용 컨테이너는하드웨어를가상화하는계층이없기 때문에메모리접근, 파 일시스템, 네트워크속도가 가상머신에비해월등히빠름.
  6. 6. Docker Architecture
  7. 7. Docker Install 컨테이너기능은리눅스커널에서만지원하기 때문에Windows나OS X에서 실행불가능, 따라서가상머신에리눅스를설치하고 그 위에Docker를실행 Docker Engine: Docker가 탑재된기본엔진 Docker CLI: Command Line Interface Docker‑Compose: 설정파일(Dockerfile)로컨테이너를관리 Docker‑Machine: 로컬에Docker 호스트를구성
  8. 8. Docker Install 1. Boot2Docker 15년9월부터Deprecated 2. Docker for Mac HyperKit 이라는macOS를위한경량화가상머신을사용 Mac Application으로관리하여편함 3. Docker Toolbox Oracle의VirtualBox를통해가상화 기존에써왔던VirtualBox를꼭써야하는경우
  9. 9. Docker Command # 상태 확인하기 docker ps docker images # 이미지 받아오기 docker search nginx docker pull nginx # 컨테이너 실행하기 docker run -d -p 80:80 --name webserver nginx # 컨테이너 중지/재실행하기 docker stop webserver docker restart webserver docker start webserver # 컨테이너/이미지 삭제하기 docker rm -f webserver docker rmi webserver
  10. 10. How to use 1. DockerHub : https://hub.docker.com/ 2. Dockerfile : https://docs.docker.com/engine/reference/builder/ 3. Docker‑Registry : https://docs.docker.com/registry/
  11. 11. DockerHub란? 도커컨테이너를관리하고 공유하기 위한SAAS로 GitHub 처럼이미지를올려서공유하거나내려받을수있음 1개의private repo, 여러개의public repo 제공
  12. 12. Dockerfile # Pull image FROM centos:latest MAINTAINER Swalloow "joon920570@gmail.com" # Running on image RUN yum update -y RUN yum install python-pip python-dev build-essential # Running on container COPY . /app WORKDIR /app RUN pip install -r requirements.txt ENTRYPOINT ["python"] CMD ["app.py"] docker build ./ : 현재디렉토리의Dockerfile을찾아서빌드
  13. 13. Docker Registry란? 설치형Private Docker 저장소(Flask 기반) DockerHub가 GitHub이라면, Docker Registry는GitLab 같은존재 https://github.com/docker/docker‑registry https://github.com/docker/distribution docker pull registry docker run --name local -d -p 5000:5000 registry
  14. 14. Docker Registry image to S3 나는정말AWS를좋아하고 이미지가 안전해야마음이놓인다...
  15. 15. Docker Usecase
  16. 16. Docker로웹서비스무중단배포하기
  17. 17. AWS EC2 Container Registry
  18. 18. AWS EC2 Container Service
  19. 19. Docker로모든어플리케이션을컨테이너로만든다면서버는Docker를 돌리기 위해존재할뿐이다 https://swalloow.github.io/docker‑install https://swalloow.github.io/docker‑command

×