首页 > 解决方案 > 错误:对于未经授权的nodejs:未授权访问所请求的资源

问题描述

我想将 sylius 与 docker 一起使用

我按照官网相同的步骤进行操作;

当我输入命令“docker-compose pull --ignore-pull-failures || true”时,出现以下错误:

Pulling mysql   ... done
Pulling php     ... error
Pulling nodejs  ... error
Pulling nginx   ... error
Pulling mailhog ... done

ERROR: for nginx  unauthorized: access to the requested resource is not authorized

ERROR: for nodejs  unauthorized: access to the requested resource is not authorized

ERROR: for php  unauthorized: access to the requested resource is not authorized
ERROR: unauthorized: access to the requested resource is not authorized
unauthorized: access to the requested resource is not authorized
unauthorized: access to the requested resource is not authorized

帮我高级副总裁

标签: dockersylius

解决方案


我通过从 dockercompose.yml 中删除缓存和图像来让它工作:

  nginx:
    build:
      context: .
      target: sylius_nginx
      cache_from:
        - quay.io/sylius/php:latest
        - quay.io/sylius/nodejs:latest
        - quay.io/sylius/nginx:latest
    image: quay.io/sylius/nginx:latest
    depends_on:
      - php
      - nodejs # to ensure correct build order

像这样删除 cache_from 和 image:

  nginx:
    build:
      context: .
      target: sylius_nginx
    depends_on:
      - php
      - nodejs

对 php: 和 nodejs 执行相同的操作。


推荐阅读