본문 바로가기
공부/Trouble Shooting

docker에 kafka, zookeeper 설치 오류

by son_i 2023. 10. 16.
728x90

docker-compose.yml 파일 생성

version: '2'
services:
  zookeeper:
    image: wurstmeister/zookeeper
    container_name: zookeeper
    ports:
      - "2181:2181"
    networks:
      - fintech
  kafka:
    image: wurstmeister/kafka:2.12-2.5.0
    container_name: kafka
    ports:
      - "9092:9092"
    environment:
      KAFKA_ADVERTISED_HOST_NAME: kafka
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - fintech
  api:
    image: api:0.0.1
    container_name: api
    ports:
      - "80:80"
    networks:
      - fintech
  consumer:
    image: consumer:0.0.1
    container_name: consumer
    ports:
      - "8080:8080"
    networks:
      - fintech
  css:
    image: css:0.0.1
    container_name: css
    ports:
      - "8081:8081"
    networks:
      - fintech
  nginx:
    image: nginx:0.0.1
    container_name: nginx
    ports:
      - "8085:8085"
    networks:
      - fintech

networks:
  fintech:
    driver: bridge

터미널에서 띄우기

$ docker-compose up -d

 

-> 오류 발생

[+] Running 6/6 4.9s
✘ nginx Error 5.0s
✘ css Error 5.0s
✘ zookeeper Error 5.0s
✘ api Error 5.0s
✘ consumer Error 5.0s
✘ kafka Error 5.0s
Error response from daemon: pull access denied for css, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

➡️원인

Docker hub repository에 로그인 되지 않아서 접근할 수 없을 때 발생 (도커 저장소를 이용할 때)

 

➡️해결

docker 홈페이지에서 회원가입 Docker Hub

 

Docker Hub Container Image Library | App Containerization

Deliver your business through Docker Hub Package and publish apps and plugins as containers in Docker Hub for easy download and deployment by millions of Docker users worldwide.

hub.docker.com

docker desktop에 로그인하고

 

터미널에서 docker login입력하면 아이디와 패스워드 입력해야한다는데 나는 docker desktop에 로그인 되어있어서 그런가 바로 아래와 같은  화면이 떴다.

 

엥 ? 그래도 안 됨 뭐지

아놔 강사님 코드에서 설정파일 복붙했는데 아직 안 쓰는 것들도 설정되어있어서 그랬음 ;; 지우니까 됐당

728x90