【问题标题】:Docker can't connect and pull an image from an existing repositoryDocker 无法从现有存储库连接和拉取图像
【发布时间】:2021-02-19 08:46:30
【问题描述】:

我为此苦苦思索了 6 个多小时,但无济于事。

每当我运行这段代码时:

docker run --name mina -d \
-P 8302:8302 \
--restart=always \
--mount "type=bind,source=`pwd`/keys,dst=/users/gb/keys,readonly" \
--mount "type=bind,source=`pwd`/.coda-config,dst=/users/gb/.coda-config" \
--mount "type=bind,source=`pwd`/peers.txt,dst=/users/gb/peers.txt,readonly" \
-e CODA_PRIVKEY_PASS=PASSWORD \
gcr.io/o1labs-192920/coda-daemon-baked:0.4.2-245a3f7-zenith-7a89538 \
daemon \
-peer-list-file /users/gilbertbassey/peers.txt \
--block-producer-key /users/gb/keys/my-wallet \
--insecure-rest-server \
--file-log-level Debug \
--log-level Info \

我明白了:

Unable to find image '8302:8302' locally
docker: Error response from daemon: pull access denied for 8302, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

我知道存储库存在是因为其他人访问了它。我正在使用 Docker 桌面在我的 Mackbook 终端上运行此代码。

更多上下文:我正在尝试连接到区块链网络。

编辑:

事实证明,由于我的密码,我一直遇到这个问题。它有一些 docker 误解/删除的特殊字符。具体来说,密码末尾的!! 似乎是问题所在。如何以 docker 不会误解的方式编写它?

【问题讨论】:

  • 您有一个-P 选项,带有大写的“P”;这告诉 Docker 发布所有公开的端口并且不带参数,反过来,这会导致下一个参数被解释为图像名称。你的意思是-p 带有小写的“p”吗?

标签: docker docker-for-mac


【解决方案1】:

您似乎使用错误的参数打开了端口

Unable to find image '8302:8302' locally
docker: Error response from daemon: pull access denied for 8302, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

无法在本地找到图像'8302:8302',表示未找到,因为还没有这样的图像

[尝试]

docker run --name mina -d \
-p 8302:8302 \
--restart=always \
--mount "type=bind,source=`pwd`/keys,dst=/users/gb/keys,readonly" \
--mount "type=bind,source=`pwd`/.coda-config,dst=/users/gb/.coda-config" \
--mount "type=bind,source=`pwd`/peers.txt,dst=/users/gb/peers.txt,readonly" \
-e CODA_PRIVKEY_PASS=PASSWORD \
gcr.io/o1labs-192920/coda-daemon-baked:0.4.2-245a3f7-zenith-7a89538 \
daemon \
-peer-list-file /users/gilbertbassey/peers.txt \
--block-producer-key /users/gb/keys/my-wallet \
--insecure-rest-server \
--file-log-level Debug \
--log-level Info 

要打开端口,您必须使用 -p 而不是 -P

【讨论】:

  • 非常感谢您的回复。原始代码有 -p 但我改变了它,因为我得到了错误。但现在我发现问题出在我的密码上。出于某种原因,docker 没有完全阅读它。 -e CODA_PRIVKEY_PASS=@sdsfaGH!! 这是我所有错误的原因。现在我需要弄清楚如何让系统读取密码而不弄乱它。我注意到它一直在删除感叹号
  • 您可以将密码作为字符串发送。例如 CODA_PRIVKEY_PASS="@sdsfaGH!!"
  • 这对我不起作用。我必须使用set +H 关闭哈希扩展,以便程序可以读取!! 而无需扩展/执行它。非常感谢您的帮助,非常感谢。
猜你喜欢
  • 1970-01-01
  • 2020-07-05
  • 2021-12-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-28
  • 2021-01-05
  • 2022-11-11
相关资源
最近更新 更多