Getting error "Error getting credentials – err: exit status 1, out : “" when trying to build on my mac but in ubuntu everything looks good

huangapple go评论107阅读模式
英文:

Getting error "Error getting credentials - err: exit status 1, out : ``" when trying to build on my mac but in ubuntu everything looks good

问题

Here are the translated parts:

当我尝试在我的Mac上构建时,发生了以下问题 "Error getting credentials - err: exit status 1, out:"

在我的Mac上构建Django项目时。

发生以下问题。

我的docker-compose:

  1. version: "3.3"
  2. services:
  3. db:
  4. image: postgres:14.0-alpine
  5. environment:
  6. POSTGRES_USER: ${SQL_USER}
  7. POSTGRES_PASSWORD: ${SQL_PASSWORD}
  8. POSTGRES_DB: ${SQL_DATABASE}
  9. volumes:
  10. - rbn_db:/var/lib/postgresql/data
  11. networks:
  12. - rbn
  13. web:
  14. build: ./
  15. # command: gunicorn monsite.wsgi:application --bind 0.0.0.0:8000
  16. command: python manage.py runserver 0.0.0.0:8000
  17. volumes:
  18. - ./:/code
  19. ports:
  20. - "9005:8000"
  21. env_file:
  22. - ./.env
  23. depends_on:
  24. - db
  25. networks:
  26. - rbn
  27. volumes:
  28. rbn_db:
  29. networks:
  30. rbn:
  31. driver: bridge

.env文件:

  1. DEBUG=1
  2. SECRET_KEY=(gq!il9r&&a49rweb47qxwwogjsqeq2$hl0+6s6nx8dx^3
  3. DJANGO_ALLOWED_HOSTS=localhost;127.0.0.1
  4. SQL_ENGINE=django.db.backends.postgresql
  5. SQL_DATABASE=rbn
  6. SQL_USER=rbn_user
  7. SQL_PASSWORD=gjjhgfjgfdgfgdsfsf
  8. SQL_HOST=db
  9. SQL_PORT=5432
  10. DJANGO_DEBUG=True

Please note that I have retained the original formatting and placeholders used in the provided code and text.

英文:

When it was trying to build on my Mac, the following issue occurred "Error getting credentials - err: exit status 1, out:"

When I was building the Django project on my Mac.

The following issue is occurring.

  1. sudo docker-compose -f docker-compose.dev.yml up -d --build
  2. Password:
  3. WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
  4. WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
  5. WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
  6. WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
  7. 2023/05/21 14:09:08 must use ASL logging (which requires CGO) if running as root
  8. [+] Running 0/0
  9. db Pulling 0.0s
  10. error getting credentials - err: exit status 1, out: ``

My docker-compose :

  1. version: "3.3"
  2. services:
  3. db:
  4. image: postgres:14.0-alpine
  5. environment:
  6. POSTGRES_USER: ${SQL_USER}
  7. POSTGRES_PASSWORD: ${SQL_PASSWORD}
  8. POSTGRES_DB: ${SQL_DATABASE}
  9. volumes:
  10. - rbn_db:/var/lib/postgresql/data
  11. networks:
  12. - rbn
  13. web:
  14. build: ./
  15. # command: gunicorn monsite.wsgi:application --bind 0.0.0.0:8000
  16. command: python manage.py runserver 0.0.0.0:8000
  17. volumes:
  18. - ./:/code
  19. ports:
  20. - "9005:8000"
  21. env_file:
  22. - ./.env
  23. depends_on:
  24. - db
  25. networks:
  26. - rbn
  27. volumes:
  28. rbn_db:
  29. networks:
  30. rbn:
  31. driver: bridge

.env file :

  1. DEBUG=1
  2. SECRET_KEY=(gq!il9r&&a49rweb47qxwwogjsqeq2$hl0+6s6nx8dx^3
  3. DJANGO_ALLOWED_HOSTS=localhost;127.0.0.1
  4. SQL_ENGINE=django.db.backends.postgresql
  5. SQL_DATABASE=rbn
  6. SQL_USER=rbn_user
  7. SQL_PASSWORD=gjjhgfjgfdgfgdsfsf
  8. SQL_HOST=db
  9. SQL_PORT=5432
  10. DJANGO_DEBUG=True

答案1

得分: 1

尝试编辑 ~/.docker/config.json,将 "credsStore": "desktop" 替换为 "credsStore": "osxkeychain"

英文:

Try editing ~/.docker/config.json and replacing "credsStore": "desktop" with "credsStore": "osxkeychain".

huangapple
  • 本文由 发表于 2023年5月21日 17:27:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76299173.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定