Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Archives
Today
Total
관리 메뉴

:)

Docker history, install 본문

Docker

Docker history, install

mihee 2022. 4. 18. 12:26

chroot

  • change root directory
    • root dir.를 특정 디렉터리로 변경
    • UNIX command 및 system call로 존재

chroot practice

ftp 서비스를 제공하는 vsftpd 설치

$ sudo apt -y install vsftpd

설치 후 서비스 running 확인

$ sudo systemctl is-active vsftpd

ftp 클라이언트 프로그램인 filezilla를 설치 후 실행

$ sudo apt -y install filezilla
$ filezilla

Isolation

  • 격리(isolation)의 필요성
    • 시스템 내에 존재하는 자원은 한정적
      • 한정적인 자원을 효율적으로 분배하면 시스템의 가용성을 올릴 수 있음

Isolation의 활용

  1. 보안, 자원 관리적 측면
    • 특정 파일 경로의 접근을 제한(특정 시스템 자원의 사용을 제한)
    • 호스팅 업체라면 고성능 컴퓨터 1대로 여러 사업자에게 DB나 웹 제공 가능
  2. 호환, 충돌 측면(바이너리의 동시 실행)
    • 동일한 디렉터리를 사용하는 프로세스의 독립된 실행
    • 서로 다른 버전의 파일을 사용하는 프로세스
    • 시스템에서 격리된 공간을 제공하여 문제 해결

Name space

  • 분산 컴퓨팅 시스템으로서 local system, remote system을 hierarchical file system으로 표현(path 형태로 표현 가능)
  • Linux Namespace : isolated resources를 NS의 hierarchical file system 형태로 구현

cgroup (control group)

  • OS level abstraction
    • group 별로 가상화된 공간을 만들고 자원을 제약할 수 있게됨
      • 다른 그룹은 격리되어있으므로 마치 물리적으로 다른 호스트처럼 인식
    • docker, hadoop, systemd 수많은 프로젝트들이 cgroup을 사용

docker

  • container runtime
  • docker는 container를 세련된 방식으로 구현한 제품의 일종
    • 격리된 자원의 묶음(image)과 런타임으로 구성, client system 구조 -> daemon이 작동됨.
    • Host OS위에서 작동하는 격리된 프로세스의 일종이므로 virtual machine과 달리 Memory, File system의 I/O에서 발생되는 크리티컬한 overhead가 없다.
      • 단점 : damon으로 작동하면서 child process로 수직 관리(damon문제 생기면 밑에 있는 모든 container가 같이 사망.), 관리자 권한 사용

podman

  • alternative of linux container
    • docker가 가장 많이 쓰이고 있지만 단점과 상용화 문제로 인해 대안 요구
    • podman은 RedHat에서 지원
      • no daemon service, no admin account
      • systemd unit support(상용화 시키기 좋음)

Install docker

필요 패키지 설치

$ apt update
$ apt -y install apt-transport-https/ ca-certofocates/curl/gnupg/lsb-release

key file 추가

# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

APT 저장소 source.list추가

# echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list

docker engine의 설치

# apt update
# apt -y install docker-ce docker-ce-cli containerd.io

docker test 이미지 : hello-world

# docker run hello-world   #설치확인. 처음 실행시 image가 없으므로 자동으로 pulling해서 hello-world 이미지 받음.

docker run -it ubuntu bash

-i : interactive mode(open stdin), -t : terminal(Allocate a pseudo-TTY, stdio)

 

'Docker' 카테고리의 다른 글

docker 안에서 GUI 실행하기(ex.. plt.show())  (0) 2022.04.27
docker-compose  (0) 2022.04.21
docker CLI  (0) 2022.04.20
Comments