터칭 데이터

Docker & K8S - Virtual Machines vs. Docker Containers 본문

Docker & K8S

Docker & K8S - Virtual Machines vs. Docker Containers

터칭 데이터 2023. 12. 18. 11:25

 

Virtual machine과 container의 차이점에 대해 배워보자

 

 

 

 

 

 

 

 

Virtual Machine 소개

 

AWS의 EC2가 대표적인 Virtual Machine (VM)

 

하드웨어를 추상화하여 한 컴퓨터 위에 가상 컴퓨터를 올리는 것

즉 컴퓨터 하드웨어 단의 추상화

 

 

 

Virtual Machines: 보통 하나의 컴퓨터 위에 다수의 VM을 실행하는 것이 일반적, 이 안에서 소프트웨어가 동작

VM을 생성하고 관리하기 위한 소프트웨어: VMWare, VirtualBox, Hyper-v, …

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Virtual Machine의 장단점

 

장점

소프트웨어를 실행하기 위한 독립적이고 분리된 공간을 제공
다수의 소프트웨어를 각 VM단에서 독립적으로 실행가능

 

단점

각 VM은 자신만의 OS를 필요로 함 (가상 하드웨어위에서 돌기 때문)

    - 유료 OS라면 라이센스 비용 필요
    - 그러다보니 시작하는데 오래 걸림


자원을 많이 사용함 (VM들끼리 자원을 나눠써야함)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Docker Container 소개

 

소프트웨어를 실행하기 위한 독립적이고 분리된 공간

 

자체 파일 시스템을 갖고 있음 (Volume이라고 부름)

 

 

 

 

 

Docker Engine을 매우 경량화된 VM이라고 생각하셔도 이해에 크게 무리가 없습니다.

 

 

 

 

 

 

 

 

 

 

 

Container의 장단점

 

장점

소프트웨어를 실행하기 위한 독립적이고 분리된 공간을 제공

    - 다수의 소프트웨어를 각 컨테이너단에서 독립적으로 실행가능


자원 소비가 적음 (lightweight)

    - 몇 십개에서 몇 백개의 container를 실행 가능


호스트 OS를 사용 (별도 비용 없음)

    - 따라서 빠르게 실행됨

 

단점

많은 수의 Docker Container를 관리하는 것은 쉽지 않음


Host OS를 사용하기에 Cross-platform compatibility를 항상 지원하지 않음

Cross-platform compatibility refers to the ability of a software to run identically on different operating systems and environments. For example, a cross-platform application could run on Windows, macOS, and Linux without requiring any modifications.

When it comes to Docker, it's designed to be cross-platform. You can build a Docker image on one type of system (like a Windows machine), and run it on a different type of system (like a Linux server). This is because Docker containers run on the Docker engine, not directly on the host OS. The Docker engine acts as a layer of abstraction between the container and the host OS.

However, there are some caveats. Docker containers use the host system's kernel. This means that you can't run a container built for a Linux system on a Windows host without some form of emulation or virtualization, because the Linux container relies on Linux kernel features. Docker solves this on Windows by running a lightweight Linux VM in the background.

Also, there can be differences in file paths, line endings, and other system-specific details between Windows and Unix-like systems (like Linux and macOS). These differences can sometimes cause issues if not properly handled.

In summary, while Docker greatly improves cross-platform compatibility by isolating applications and their dependencies into containers, there can still be issues due to differences between operating systems, especially between Windows and Unix-like systems.

 


GUI 소프트웨어 개발에 적합치 않음

 

 

 

 

 

 

 

 

 

 

 

 

 

Virtual Machines와 (Docker) Containers 비교

 

 

 

 

 

 

'Docker & K8S' 카테고리의 다른 글

Docker & K8S - Docker 프로그램 개발 프로세스  (0) 2023.12.18
Docker & K8S - Docker 설치  (0) 2023.12.18
Docker & K8S - Docker 소개  (0) 2023.12.18
Docker & K8S - Airflow 운영상의 어려움  (0) 2023.12.18
Docker & K8S  (0) 2023.12.18