AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / coding / 问题 / 79577924
Accepted
Raphael10
Raphael10
Asked: 2025-04-17 02:54:34 +0800 CST2025-04-17 02:54:34 +0800 CST 2025-04-17 02:54:34 +0800 CST

推送到 docker repo:请求的资源访问被拒绝

  • 772

构建docker镜像:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ export MYREPO=raphaelcollab/stunner
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ sudo docker build -t $MYREPO/nexus .
[+] Building 71.6s (29/29) FINISHED                                                                                                                                                          docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                   0.0s
 => => transferring dockerfile: 2.79kB                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/debian:bookworm-20240701-slim                                                                                                                       0.0s
 => [internal] load metadata for docker.io/hexpm/elixir:1.17.2-erlang-27.0.1-debian-bookworm-20240701-slim                                                                                             0.0s
 => [internal] load .dockerignore                                                                                                                                                                      0.0s
 => => transferring context: 1.31kB                                                                                                                                                                    0.0s
 => [internal] load build context                                                                                                                                                                      0.1s
 => => transferring context: 158.99kB                                                                                                                                                                  0.0s
 => [stage-1 1/6] FROM docker.io/library/debian:bookworm-20240701-slim                                                                                                                                 0.0s
 => [builder  1/17] FROM docker.io/hexpm/elixir:1.17.2-erlang-27.0.1-debian-bookworm-20240701-slim                                                                                                     0.1s
 => [stage-1 2/6] RUN apt-get update -y &&   apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates   && apt-get clean && rm -f /var/lib/apt/lists/*_*                              9.4s
 => [builder  2/17] RUN apt-get update -y && apt-get install -y build-essential git pkg-config libssl-dev     && apt-get clean && rm -f /var/lib/apt/lists/*_*                                        28.4s
 => [stage-1 3/6] RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen                                                                                                                     1.5s
 => [stage-1 4/6] WORKDIR /app                                                                                                                                                                         0.1s
 => [stage-1 5/6] RUN chown nobody /app                                                                                                                                                                0.2s
 => [builder  3/17] WORKDIR /app                                                                                                                                                                       0.0s
 => [builder  4/17] RUN mix local.hex --force &&     mix local.rebar --force                                                                                                                           2.1s
 => [builder  5/17] COPY mix.exs mix.lock ./                                                                                                                                                           0.1s
 => [builder  6/17] RUN mix deps.get --only prod                                                                                                                                                       2.9s
 => [builder  7/17] RUN mkdir config                                                                                                                                                                   0.2s
 => [builder  8/17] COPY config/config.exs config/prod.exs config/                                                                                                                                     0.1s
 => [builder  9/17] RUN mix deps.compile                                                                                                                                                              27.5s
 => [builder 10/17] COPY priv priv                                                                                                                                                                     0.0s
 => [builder 11/17] COPY lib lib                                                                                                                                                                       0.1s
 => [builder 12/17] COPY assets assets                                                                                                                                                                 0.1s
 => [builder 13/17] RUN mix assets.deploy                                                                                                                                                              6.6s
 => [builder 14/17] RUN mix compile                                                                                                                                                                    0.7s
 => [builder 15/17] COPY config/runtime.exs config/                                                                                                                                                    0.1s
 => [builder 16/17] COPY rel rel                                                                                                                                                                       0.0s
 => [builder 17/17] RUN mix release                                                                                                                                                                    1.4s
 => [stage-1 6/6] COPY --from=builder --chown=nobody:root /app/_build/prod/rel/nexus ./                                                                                                                0.4s
 => exporting to image                                                                                                                                                                                 0.6s
 => => exporting layers                                                                                                                                                                                0.5s
 => => writing image sha256:a0e0d292a593181591b1e354c7c5364717e1043cd2fd21acb8f7d3673ed8372d                                                                                                           0.0s
 => => naming to docker.io/raphaelcollab/stunner/nexus

注销和登录:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker logout
Removing login credentials for https://index.docker.io/v1/

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker login -u raphaelcollab

创建 docker 标签:(docker push 错误“拒绝:请求的资源访问被拒绝”)

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker tag docker.io/raphaelcollab/stunner/nexus:latest docker.io/raphaelcollab/stunner/nexus

尝试推送到 docker repo:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker push docker.io/raphaelcollab/stunner/nexus
Using default tag: latest
The push refers to repository [docker.io/raphaelcollab/stunner/nexus]
0603097560bf: Preparing 
b5a39b1ed0d7: Preparing 
6ecbac9c9860: Preparing 
49d482126ff0: Preparing 
c5a36b2dc9a4: Preparing 
32148f9f6c5a: Waiting 
denied: requested access to the resource is denied

操作系统:Ubuntu 24.04

附录1:docker login -u 的输出:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker login -u     
raphaelcollab

i Info → A Personal Access Token (PAT) can be used instead.
         To create a PAT, visit https://app.docker.com/settings
     
     
Password: 
Login Succeeded
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ 

附录2:

这是我在 docker 中创建的 repo:

在此处输入图片描述

在此处输入图片描述

附录3:

我只能创建名为 stunner 的 repo,而不能创建名为 stunner/nexus 的 repo

在此处输入图片描述

在此处输入图片描述

当我推送到 docker.io/raphaelcollab/stunner/nexus:latest 时,访问被拒绝:

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker tag 
raphaelcollab/stunner/nexus:latest raphaelcollab/stunner/ 
nexus:latest

(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker push docker.io/raphaelcollab/stunner/nexus:latest
The push refers to repository [docker.io/raphaelcollab/stunner/nexus]
0603097560bf: Preparing 
b5a39b1ed0d7: Preparing 
6ecbac9c9860: Preparing 
49d482126ff0: Preparing 
c5a36b2dc9a4: Preparing 
32148f9f6c5a: Waiting 
denied: requested access to the resource is denied

如何让它工作?

docker
  • 1 1 个回答
  • 34 Views

1 个回答

  • Voted
  1. Best Answer
    poisoned_monkey
    2025-04-17T04:40:30+08:002025-04-17T04:40:30+08:00

    Docker Hub repo使用格式

    <org-or-user-namespace>/<repo-name>:<tag>

    似乎docker.io/raphaelcollab/stunner/nexusrepo 不存在。您应该先显式创建docker.io/raphaelcollab/stunner/nexus repo,然后标记

    docker tag <<existing-image>> docker.io/raphaelcollab/stunner/nexus:latest
    

    然后再次尝试推动

    docker push docker.io/raphaelcollab/stunner/nexus:latest
    

    换句话说,您需要创建raphaelcollab/stunner/nexusrepo 或使用命令推送docker push docker.io/raphaelcollab/stunner:latest

    • 1

相关问题

  • 如何更新 Docker 基础镜像的权限?

  • Docker 构建:/make:权限被拒绝

  • VSCode 运行旧容器时出现问题

  • Docker 绑定()到 0.0.0.0:3000 失败

  • 如何追踪“docker scout cves”显示的漏洞来源

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve