1. 로그 및 모니터링운영 환경에서는 단순히 docker logs 명령어로 로그를 확인하는 것보다 중앙 로그 시스템을 활용하는 것이 효율적이다. Prometheus + Grafana 모니터링 스택Prometheus는 메트릭 수집을 담당하고, Grafana는 시각화 대시보드를 제공한다.services: prometheus: image: prom/prometheus:latest volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml ports: - "9090:9090" grafana: image: grafana/grafana:latest depends_on: - prometheus ports: ..
1. build - 컨테이너 빌드 관련 설정build: context: . dockerfile: Dockerfile args: ENV_VAR_NAME: value옵션설명context: .현재 디렉토리를 빌드 컨텍스트로 사용dockerfile: Dockerfile.prod특정 Dockerfile을 사용 가능args:Docker 빌드 시 전달할 변수 (ARG) 예제: Dockerfile.dev를 사용해 개발 환경 빌드build: context: . dockerfile: Dockerfile.dev 2. image - 빌드 없이 특정 이미지 사용image: my-app:latest 이미 빌드된 Docker 이미지를 사용하려면 build: 대신 image: 를 사용Docker Hub, 프라이빗 레지..
Docker Compose란?Docker Compose는 여러 개의 Docker 컨테이너를 한 번에 관리할 수 있도록 도와주는 툴이다.docker-compose.yml 파일을 사용해서 컨테이너 실행, 네트워크 연결, 볼륨 마운트 등의 작업을 자동화할 수 있다. 주요 기능여러 컨테이너를 한 번에 실행환경변수 관리네트워크 자동 설정볼륨을 통한 데이터 유지간단한 명령어로 배포 자동화 가능 예제Nginx + MySQL을 실행하는 기본적인 docker-compose.ymlversion: '3' # Docker Compose 버전services: nginx: # 웹 서버 서비스 image: nginx:latest ports: - "8080:80" volumes: - ./ngi..
Docker Desktop의 GUI 환경에서 간단하게 nginx를 실행해 보는 과정을 정리했습니다. 1. Dcoker Hub 탭에서 nginx 검색 후 이미지 추가 pull로 이미지를 가져온다. 2. 이미지로 컨테이너 생성 Images 탭에 들어가서 nginx 이미지의 run 버튼을 눌러준다. 그럼 아래처럼 뜨는데오른쪽 화살표를 누르면 추가 설정을 할 수 있다. 생성할 컨테이너의 이름, 포워딩할 port, Volume, 환경 변수를 설정해줄 수 있다. 도커의 컨테이너는 기본적으로 외부의 접속을 차단하기때문에 접속을 하려면 포트포워딩이 필수다ex) Host port를 9000으로 설정, localhost:9000으로 컨테이너의 80 포트로 접속 가능 혹은 아래 명령어로도 실행가능 docker r..
Window 환경에서 Docker Desktop 설치하는 법 정리해봤습니다. 설치과정1. 설치 파일 다운로드 WindowsGet started with Docker for Windows. This guide covers system requirements, where to download, and instructions on how to install and update.docs.docker.com 위 링크에서 Docker Desktop을 다운로드한다. 2. 설치 파일 실행.exe 파일을 실행해서 설치를 하고 pc를 재시작하면 Docker가 자동으로 실행된다.Accept 눌러서 이용동의 해주고 recommand setting으로 설치해주자 아래같은 오류가 뜬다면? 아래 명령어로 파워쉘에서 WSL을 홀..
Linux 기반 가상머신(VM)에 도커 설치하는 방법 설명 설치과정 1. 시스템 업데이트apt update 2. 필수 패키지 설치sudo apt install -y ca-certificates curl gnupg 3. GPG 키 추가sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/null sudo chmod a+r /etc/apt/keyrings/docker.asc 4. Docker 저장소 추가echo \ "deb [arch=$(dpkg --print-architecture) signe..