错误:拒绝对postgress的拉取访问,存储库不存在或可能需要“docker登录”:拒绝:请求的资源访问被拒绝

2024-10-06 18:17:57 发布

您现在位置:Python中文网/ 问答频道 /正文

在学习Docker使用Django时,我遇到了一些与在LinuxMint中安装PostgreSQL相关的问题

这是docker compose.yml文件中的代码

version: '3.7'

services: 
    web:
        build: .
        command: python /code/manage.py runserver 0.0.0.0:8000
        volumes: 
            - .:/code
        ports: 
            - 8000:8000
        depends_on: 
            - db

    db:
        image: postgress:11

触发docker compose up-d命令时收到的错误

Pulling db (postgress:)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling db (postgress:)...
ERROR: pull access denied for postgress, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

登录docker后仍会出现此错误


Tags: thecomposedockerimageyoufordb错误
1条回答
网友
1楼 · 发布于 2024-10-06 18:17:57

我不认为存在与docker登录相关的问题,相反,您的文件中的图像名是postgress:11(extras

见:https://hub.docker.com/_/postgres

更新的撰写文件

version: '3.7'

services: 
    web:
        build: .
        command: python /code/manage.py runserver 0.0.0.0:8000
        volumes: 
            - .:/code
        ports: 
            - 8000:8000
        depends_on: 
            - db

    db:
        image: postgres:11

相关问题 更多 >