110 lines
2.6 KiB
Markdown
110 lines
2.6 KiB
Markdown
#### 폐쇄망에서 도커 설치(tgz)
|
|
- 설치 및 기동
|
|
1. https://download.docker.com/linux/static/stable/x86_64/ 링크를 통해 원하는 도커 버전을 받는다.
|
|
2. 해당 폴더를 서버에 업로드 한다.
|
|
3. tar -xvf docker-20.10.9.tgz
|
|
4. mv * /usr/bin/
|
|
5. dockerd &
|
|
> 데몬을 시작할 때 옵션을 추가하고 싶다면 /etc/docker/daemon.json 파일을 수정해주거나 없다면 생성.
|
|
|
|
##### Compose 설치
|
|
```bash
|
|
# docker-compose 파일 다운로드
|
|
# (https://github.com/docker/compose/releases)
|
|
cp docker-compose /usr/local/bin/docker-compose
|
|
chmod +x /usr/local/bin/docker-compose
|
|
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
|
docker-compose --version
|
|
|
|
```
|
|
|
|
|
|
##### 도커 이미지 로드
|
|
```bash
|
|
|
|
docker load -i /home/gmt/SACP-INSTALL/Docker/docimg_cp-kafka.tar
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
##### Daemon 설치 및 data-root 경로 변경
|
|
```bash
|
|
# 데몬 설치전 docker 컨테이너와 프로세스 모두 종료
|
|
# /var/lib/docker 폴더 삭제
|
|
|
|
nano /etc/systemd/system/docker.service
|
|
[Unit]
|
|
Description=Systemd Docker Daemon
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=dockerd --data-root=/home/docker
|
|
Restart=on-failure
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|
|
systemctl enable docker
|
|
systemctl start docker
|
|
systemctl status docker
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
```
|
|
|
|
##### Compose 실행
|
|
1. docker-compose.yml 작성
|
|
2. docker-compose.yml 위치로 이동
|
|
3. 명령어 수행
|
|
```bash
|
|
docker-compose build && docker-compose up -d
|
|
|
|
cd /opt/SACP-INSTALL/docker-elk/
|
|
cd /opt/SACP-INSTALL/
|
|
|
|
docker exec -it kafka1 bash
|
|
|
|
|
|
## 테스트시 특정 컨테이너 및 이미지 일괄 삭제
|
|
|
|
docker rm -f logstash7 && docker rm -f es01 && docker rm -f kibana7
|
|
docker rm -f logstash7 && docker rm -f es02 && docker rm -f es03 && docker rm -f kibana7
|
|
|
|
docker rmi -f `docker images | awk '$1 ~ /elastic/ {print $3}'`
|
|
|
|
docker images
|
|
|
|
cd /opt/SACP-INSTALL/docker-elk/ && docker-compose build && docker-compose up -d
|
|
|
|
cd /opt/SACP-INSTALL/ && docker-compose build && docker-compose up -d
|
|
|
|
|
|
du -h --max-depth=1
|
|
|
|
cd /usr/share/elasticsearch/bin/
|
|
|
|
elasticsearch-certutil ca
|
|
|
|
find / -name "elastic-stack-ca.p12"
|
|
--> /usr/share/elasticsearch/elastic-stack-ca.p12
|
|
|
|
elasticsearch-certutil cert --ca elastic-stack-ca.p12
|
|
|
|
find / -name "elastic-certificates.p12"
|
|
--> /usr/share/elasticsearch/elastic-certificates.p12
|
|
|
|
|
|
|
|
```
|
|
|
|
###### CF.
|
|
https://velog.io/@ewan/%EC%9D%B8%ED%84%B0%EB%84%B7-%EC%97%86%EB%8A%94-%EC%84%9C%EB%B2%84%EC%97%90%EC%84%9C-Docker-%EC%84%A4%EC%B9%98%EB%A5%BC
|
|
|
|
https://projooni.tistory.com/entry/linux-1804-%EC%98%A4%ED%94%84%EB%9D%BC%EC%9D%B8-%ED%99%98%EA%B2%BD%EC%97%90%EC%84%9C-docker-%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC-%EC%84%A4%EC%B9%98
|
|
|