
이번 글에서는 docker compose시 발생한 error getting credentials 관련 오류 해결 방법에 대해 간단하게 살펴보고자 합니다. https://mlops-for-mle.github.io/tutorial/의 내용 중 Zookeeper와 Kafka 관련 실습 진행 과정에서 발생한 오류에 대해 작성하였습니다. 저의 docker 실습은 Windows의 wsl을 기반으로 진행되었습니다.
우선 Zookeeper와 Kafka와 관련된 docker compose의 내용은 다음과 같습니다.
# naive-docker-compose.yaml
version: "3"
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
container_name: zookeeper
ports:
- 2181:2181
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 2181
broker:
image: confluentinc/cp-kafka:7.3.0
container_name: broker
depends_on:
- zookeeper
ports:
- 9092:9092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
실습 과정에서 기존 docker compose 실행은 문제가 없었으나, 위의 파일을 실행할 때 다음과 같은 오류가 발생하였습니다.
$ docker compose -p kafka-naive -f naive-docker-compose.yaml up -d
[+] Running 0/0
⠋ broker Pulling 0.0s
⠋ zookeeper Pulling 0.0s
error getting credentials - err: fork/exec /usr/bin/docker-credential-desktop.exe: exec format error, out: ``
관련하여 검색해 보니 wsl로 docker를 설치했을 경우 종종 발생하는 오류 같았습니다. 오류 해결 방법은 해당 글(stackoverflow)에서 찾았습니다. 원래 ~/.docker/config.json의 내용은 다음과 같이 작성되어 있습니다.
$ cat ~/.docker/config.json
{
"credsStore": "desktop.exe"
}
vi를 통해 단순히 'credsStore'를 'credStore'로 변경하면 됩니다.
$ vi ~/.docker/config.json
{
"credStore": "desktop.exe"
}
수정한 이후 다시 docker compose를 실행하면 정상적으로 작동하는 것을 확인할 수 있습니다.
$ docker compose -p kafka-naive -f naive-docker-compose.yaml up -d
[+] Running 16/16
✔ broker 2 layers [⣿⣿] 0B/0B Pulled 57.3s
✔ d32323e291f3 Pull complete 53.5s
✔ ee69ff430d89 Pull complete 53.6s
✔ zookeeper 12 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 57.3s
✔ d5d2e87c6892 Pull complete 13.6s
✔ 008dba906bf6 Pull complete 13.7s
✔ bfeaabe01655 Pull complete 50.5s
✔ 2cb7eb0f5666 Pull complete 50.7s
✔ f70f416c6ce7 Pull complete 50.7s
✔ bc67d000e59b Pull complete 51.2s
✔ d6e744651f37 Pull complete 51.2s
✔ 0427d86fae81 Pull complete 51.2s
✔ 4108e73e61e1 Pull complete 51.2s
✔ ac5563423559 Pull complete 51.2s
✔ fa08a06f385f Pull complete 53.5s
✔ bddb49e2fc4d Pull complete 53.6s
[+] Running 3/3
✔ Network kafka-naive_default Created 0.1s
✔ Container zookeeper Started 2.3s
✔ Container broker Started
<참고>
exec: "docker-credential-desktop.exe": executable file not found in $PATH
I got this error during docker build: => ERROR [internal] load metadata for docker.io/library/ubuntu:18.04 ...
stackoverflow.com
'MLOps > Docker' 카테고리의 다른 글
| [Docker] cannot stop container: permission denied 오류 해결 (0) | 2025.03.05 |
|---|---|
| [Docker] Dockerfile 작성 및 실행 (1) | 2023.12.15 |
| [Docker] PostgreSQL 서버 생성 (0) | 2023.12.12 |
| [Docker] permission denied while trying to connect to the Docker daemon socket at unix 오류 해결 (2) | 2023.11.10 |
| [Docker] 자주 사용하는 명령어 정리 (0) | 2023.10.20 |
댓글