리셋 되지 말자

wsl docker-compose permission error(권한 에러) 본문

Docker

wsl docker-compose permission error(권한 에러)

kyeongjun-dev 2021. 2. 16. 19:04
Building django
Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 126, in perform_command
  File "compose/cli/main.py", line 1070, in up
  File "compose/cli/main.py", line 1066, in up
  File "compose/project.py", line 615, in up
  File "compose/service.py", line 362, in ensure_image_exists
  File "compose/service.py", line 1125, in build
  File "docker/api/build.py", line 160, in build
  File "docker/utils/build.py", line 30, in tar
  File "docker/utils/build.py", line 49, in exclude_paths
  File "docker/utils/build.py", line 214, in rec_walk
  File "docker/utils/build.py", line 214, in rec_walk
  File "docker/utils/build.py", line 184, in rec_walk
PermissionError: [Errno 13] Permission denied: '/home/ubuntu/Django/44bits-django-tutorial/django-sample-for-docker-compose/docker/data'
[4019] Failed to execute script docker-compose
ubuntu@LAPTOP:~/Django/44bits-django-tutorial/django-sample-for-docker-compose$ sudo docker-compose up -d
[sudo] password for ubuntu:
Building django
Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 126, in perform_command
  File "compose/cli/main.py", line 1070, in up
  File "compose/cli/main.py", line 1066, in up
  File "compose/project.py", line 615, in up
  File "compose/service.py", line 362, in ensure_image_exists
  File "compose/service.py", line 1125, in build
  File "docker/api/build.py", line 261, in build
  File "docker/api/build.py", line 308, in _set_auth_headers
  File "docker/auth.py", line 301, in get_all_credentials
  File "docker/auth.py", line 287, in _get_store_instance
  File "docker/credentials/store.py", line 25, in __init__
docker.credentials.errors.InitializationError: docker-credential-desktop.exe not installed or not available in PATH
[4024] Failed to execute script docker-compose

위처럼 root 디렉토리가 아니고 home/ubuntu 디렉토리에서 작업해도 자꾸 권한 문제가 나서 sudo로 실행했더니 다른 오류가 남.

docker-credential-desktop.exe가 설치 안됐거나 어쩌구 하는데 아래와 같이 해결할 수 있음

(github.com/docker/compose/issues/7495)

vi ~/.docker/config.json

{
  "credsStore": "desktop.exe"
}

위를 아래로 변경 ( '_' 추가)

{
  "_credsStore": "desktop.exe"
}
Comments