英文:
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:
version: "3.3"
services:
db:
image: postgres:14.0-alpine
environment:
POSTGRES_USER: ${SQL_USER}
POSTGRES_PASSWORD: ${SQL_PASSWORD}
POSTGRES_DB: ${SQL_DATABASE}
volumes:
- rbn_db:/var/lib/postgresql/data
networks:
- rbn
web:
build: ./
# command: gunicorn monsite.wsgi:application --bind 0.0.0.0:8000
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./:/code
ports:
- "9005:8000"
env_file:
- ./.env
depends_on:
- db
networks:
- rbn
volumes:
rbn_db:
networks:
rbn:
driver: bridge
.env文件:
DEBUG=1
SECRET_KEY=(gq!il9r&&a49rweb47qxwwogjsqeq2$hl0+6s6nx8dx^3
DJANGO_ALLOWED_HOSTS=localhost;127.0.0.1
SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=rbn
SQL_USER=rbn_user
SQL_PASSWORD=gjjhgfjgfdgfgdsfsf
SQL_HOST=db
SQL_PORT=5432
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.
sudo docker-compose -f docker-compose.dev.yml up -d --build
Password:
WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
WARN[0000] The "hl0" variable is not set. Defaulting to a blank string.
2023/05/21 14:09:08 must use ASL logging (which requires CGO) if running as root
[+] Running 0/0
⠋ db Pulling 0.0s
error getting credentials - err: exit status 1, out: ``
My docker-compose :
version: "3.3"
services:
db:
image: postgres:14.0-alpine
environment:
POSTGRES_USER: ${SQL_USER}
POSTGRES_PASSWORD: ${SQL_PASSWORD}
POSTGRES_DB: ${SQL_DATABASE}
volumes:
- rbn_db:/var/lib/postgresql/data
networks:
- rbn
web:
build: ./
# command: gunicorn monsite.wsgi:application --bind 0.0.0.0:8000
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./:/code
ports:
- "9005:8000"
env_file:
- ./.env
depends_on:
- db
networks:
- rbn
volumes:
rbn_db:
networks:
rbn:
driver: bridge
.env file :
DEBUG=1
SECRET_KEY=(gq!il9r&&a49rweb47qxwwogjsqeq2$hl0+6s6nx8dx^3
DJANGO_ALLOWED_HOSTS=localhost;127.0.0.1
SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=rbn
SQL_USER=rbn_user
SQL_PASSWORD=gjjhgfjgfdgfgdsfsf
SQL_HOST=db
SQL_PORT=5432
DJANGO_DEBUG=True
答案1
得分: 1
尝试编辑 ~/.docker/config.json
,将 "credsStore": "desktop"
替换为 "credsStore": "osxkeychain"
。
英文:
Try editing ~/.docker/config.json
and replacing "credsStore": "desktop"
with "credsStore": "osxkeychain"
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论