티스토리 뷰

https://www.youtube.com/watch?v=mECbDs9nPnM&feature=youtu.be

* linux container

- cgroup                         : 리소스(CPU,Mem,I/O 등) 격리

- namespace                    : PID, User, Net 등

- chroot                          : 파일시스템

- linux security module(LSM)


* cgroup

- 2006 google, 2.6.24 커널에 포함 

- 각종 시스템 리소스 접근제어, 리소스 제약 담당

- /sys/fs/cgroup

- /sys 없다면 마운트   :    sudo mount -t sysfs sysfs /sys

더보기


- ubuntu@ip-172-31-20-199:$ ls -al

total 0

drwxr-xr-x 15 root root 380 Jan 10 13:07 .

drwxr-xr-x 12 root root   0 Jan 27 09:18 ..

dr-xr-xr-x  5 root root   0 Jan 10 13:07 blkio

lrwxrwxrwx  1 root root  11 Jan 10 13:07 cpu -> cpu,cpuacct

dr-xr-xr-x  5 root root   0 Jan 10 13:07 cpu,cpuacct

lrwxrwxrwx  1 root root  11 Jan 10 13:07 cpuacct -> cpu,cpuacct

dr-xr-xr-x  3 root root   0 Jan 10 13:07 cpuset

dr-xr-xr-x  5 root root   0 Jan 10 13:07 devices

dr-xr-xr-x  3 root root   0 Jan 10 13:07 freezer

dr-xr-xr-x  3 root root   0 Jan 10 13:07 hugetlb

dr-xr-xr-x  5 root root   0 Jan 10 13:07 memory

lrwxrwxrwx  1 root root  16 Jan 10 13:07 net_cls -> net_cls,net_prio

dr-xr-xr-x  3 root root   0 Jan 10 13:07 net_cls,net_prio

lrwxrwxrwx  1 root root  16 Jan 10 13:07 net_prio -> net_cls,net_prio

dr-xr-xr-x  3 root root   0 Jan 10 13:07 perf_event

dr-xr-xr-x  5 root root   0 Jan 10 13:07 pids

dr-xr-xr-x  2 root root   0 Jan 10 13:07 rdma

dr-xr-xr-x  6 root root   0 Jan 10 13:07 systemd

dr-xr-xr-x  5 root root   0 Jan 10 13:07 unified


* namespace

- 글로벌 리소스에 대한 프로세스 수준의 격리 제공

- 격리 프로세스는 자기 자산이 시스템에서 유일하다고 착각 /proc/1


* chroot

- 프로세스의 root 디렉토리를 변경할 수 있음

- chroot   :    parent 디렉토리를 유지하면서 root 디렉토리를 마운트

- pivot_root  :  parent 디렉토리 없이 root 디렉토리를 마운트






* Docker

- 리눅스 컨테이너를 생성하고 실행하며 배포하는 방식을 대중화 한 플랫폼

$ docker run -it --rm busybox top

. -it  :  실행된 컨테이너와 상호작용을 할 수 있도록 (인터렉티브)

. --rm : 컨테이너 실행이 끝나면 컨테이너 삭제

. busybox  :  실행할 컨테이너

. top :  컨테이너가 실행할 명령


ex) 테스트 구성 ( https://github.com/hoonmin/xecore)









댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/08   »
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
31
글 보관함