Docker import, export, scp 명령어 실습
·
서버/Container
실습 1. CentOS7-1 서버의 httpd:latest를 실행(이름을 h11로 컨테이너 생성) 2. Docker Export를 이용해서 web.tar 파일로 저장 3. scp를 이용해서 CentOS7-2서버로 전송(/root 디렉토리로 전송) 4.docker import 시 --change 'CMD ["httpd-foreground"]' 활용해 httpd:my2로 이미지 저장 및 실행 만약 실행이 안 된다면, 환경변수 누락 메세지 확인 후 컨테이너 환경 변수 수정 명령어 ## h11생성 및 export 명령어 수행 및 scp를 활용해 web.tar 전송 [root@localhost ~]# docker run -itd -p 61300:80 --name h11 httpd:latest e95e8d5226d..
Docker save, load, tar, scp 명령어 실습
·
서버/Container
실습 1. CentOS-1의 docker images 중 centos:7과 httpd를 docker save명령어를 이용해 cal.tar로 생성 2. cal.tar를 centos7-2서버로 전송 EX) Centos7-2서버에서 ls 시 /root/cal.tar 확인 될 수 있도록 3. docker load -i 옵션을 이용해서 cal.tar의 Archive를 해제 4. docker images 이용하여 alpine과 centos:7 이미지를 확인 5. h1과 c1이라는 이름의 컨테이너를 생성하여 각 각 접속 명령어 ## cal.tar 생성 및 Centos7-2서버로 전송 명령어 [root@localhost ~]# docker save -o cal.tar httpd:latest centos:7 [root@..
Docker 복사(CP) 실습 예제
·
서버/Container
실습 1. nginx 이미지를 활용해서 n1이라는 container를 생성 2. 외부에 노출할 포트는 65080을 사용 3. index2.html 파일을 /root 디렉토리에 생성 4. 생성한 파일을 n1 container의 index.html과 교체(복사) 5. 실제 pc에서 노출한 포트를 통해서 변경된 html파일인지 확인 실습 2 1. n1 container의 nginx.conf파일을 centos7-1의 /root디렉토리로 복사 2. 복사한 파일의 설정확인
Docker에서 HaProxy 활용하여 Load Balance
·
서버/Container
구성환경 환경설정 CentOS - 01(10.0.0.1서버) httpd(apache2)설치해서 서버 설정 docker run -d -p 60080:80 --name h1 httpd ## -d 데몬실행, -p 포트설정 , --name 이름설정, httpd 아파치 설치 docker exec -it h1 /bin/bash ## h1(httpd)의 bash쉘 실행 cat > /usr/local/apache2/htdocs/index.html >> EOF ## index.html 파일에서 EOF를 칠 때까지 스크립트 입력 결과 환경설정 CentOS - 02(10.0.0.2서버) 위 01서버와 동일 다만 다른점은 서버가 nginx 결과 CentOS7- 03 yum install -y haproxy ## haproxy..