You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker Compose部署Django+PostgreSQL遇GPG密钥解密错误求助

Docker Compose执行django-admin命令时遭遇GPG解密错误

我是Docker新手,执行以下命令时出现错误:

docker compose run --rm django django-admin startproject yuuera .

错误信息如下:

[floofyflare@ArchLinux dockercomp]$ docker compose run --rm django django-admin startproject yuuera .
WARN[0000] The "sana" variable is not set. Defaulting to a blank string. 
WARN[0000] The "tg3v" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ter05" variable is not set. Defaulting to a blank string. 
WARN[0000] The "sana" variable is not set. Defaulting to a blank string. 
WARN[0000] The "tg3v" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ter05" variable is not set. Defaulting to a blank string. 
WARN[0000] The "sana" variable is not set. Defaulting to a blank string. 
WARN[0000] The "tg3v" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ter05" variable is not set. Defaulting to a blank string. 
[+] Running 0/0
 ⠋ db Pulling                                         0.0s
error getting credentials - err: exit status 1, out: `error getting credentials - err: exit status 1, out: `exit status 2: gpg: decryption failed: No secret key``

我认为Dockerfile配置没问题,但不确定docker-compose文件是否存在问题,我的docker-compose.yml内容如下:

version: "3.8"
services:
  django:
    build: .
    volumes:
      - .:/django
    ports:
      - 8000:8000
    image: django:django
    container_name: django_container
    command: python manage.py runserver 0.0.0.0:8000
    depends_on:
      - db
  db:
    image: postgres
    volumes: 
      - ./data/db:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=admin
      - POSTGRES_PASSWORD=...
      - POSTGRES_DB=...
    container_name: postgres_db

我已经尝试关闭本地运行的PostgreSQL实例,修改docker-compose.yml中的环境变量,但都没解决问题,请求帮助。


内容的提问来源于stack exchange,提问作者Raymond Flowers IV

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 09:22:49