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评论68阅读模式
英文:

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".

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:

确定