Duruan NFVi Infra
2018.04 황인성
Chapter
Docker 개념
목차
1. VM 과 Docker
2. Image & Container
Image
3. Network
3. Network
4. Storage
4. Storage
5. Swarm
5. Swarm 에서 사용하는 용어
5. Swarm 에서 제공하는 기능
(여기서 말하는 Service 는 하나의 Application 단위)
Docker 사용법
목차
1. Docker 설치
$ sudo apt-get update
$ sudo apt-get install apt-transport-https \� ca-certificates \� curl \� software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce
2. image
$ docker search ubuntu�
$ docker pull ubuntu:latest�
$ docker images�
$ docker rmi ubuntu:latest
3. container
$ docker run -it --name hello ubuntu bash
-it: interactive option
--name hello: container 명을 hello 로 지정
ubuntu: image 명
bash: ubuntu image 에 bash 명령으로 실행�
$ docker ps -a
-a: list all (exited 된 Container 까지 출력)�
$ docker start hello
3. container
$ docker attach hello�
$ docker exec hello ps -ef
$ docker exec -it hello bash�
$ docker rm hello
$ docker rm -f hello
4. network & volume
$ docker network ls�
$ docker network inspect bridge�
$ docker network prune
5. Dockerfile
$ docker build -t myimage:tag .
FROM | base 가 될 image 명 |
RUN | 명령을 실행 |
ENV | 환경변수 |
WORKDIR | RUN, CMD, ENTRYPOINT 명령이 실행될 디렉터리 |
EXPOSE | Host 와 연결 될 port 번호 |
VOLUME | Host 시스템에 mount 할 수 있는 옵션 |
ENTRYPOINT | Container 시작 시 시작될 스크립트 또는 명령어 |
CMD | ENTRYPOINT 가 있으면 매개변수가 되고, 없으면 Container 시작 시 명령어 |
6. docker-compose
$ docker-compose up -d
$ docker-compose down
7. swarm
Swarm initialized: current node (4fak097999sik2bph9j2u1gfa) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join \
--token SWMTKN-1-3aw8a6iqn5itaxrz1xzpv8dxmbbabx0ae52be5pyug2ycjnqwd-2fxkgi2khi7u8b1v90hh6hdby \
10.10.0.50:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
8. stack
9. service
ShadowCube Dockerizing
목차
1. 신규 설치
$ docker stack deploy -c docker-compose.yml ShadowCube� ① ② ③
①: docker stack 명령어
②: docker-compose 파일 (두루안에서 제공)
③: Stack 명칭
2. 업데이트
$ docker service update --image scpc:6.1.8 scpc.1.abcdef� ① ② ③
①: docker service update 명령어
②: 업데이트할 image 명
③: stack 에 의해 생성된 service 명
3. High Availability
4. SCPC 구성
5. Volume 구성
Duruan NFVi Infra
(bowhead)
목차
1. Log Router
2. Proxy
docker swarm 이벤트를 듣고 변경이 발생하면 요청을 보내는 서비스�
Proxy 서비스
3. Monitoring
Cadvisor grafana telegraf
4. Elastic Search
5. Web Manager
감사합니다.