![](/img/trans.png)
[英]Is the sha256 hash of a docker image different between repositories?
[英]Docker build failure -- how to run image by sha256 hash?
我在嘗試構建我的 Dockerfile 之一時遇到錯誤,
❯ docker build --build-arg env=development . --progress=plain
#1 [internal] load build definition from Dockerfile
#1 sha256:c3c9b42a729c6c2731ead1895724c3f53c55d67fe58c7ce2fcd2093556b293d6
#1 transferring dockerfile: 32B 0.0s done
#1 DONE 0.0s
...
#8 [4/4] RUN yarn install --frozen-lockfile --production=false --non-interactive
#8 sha256:82e644b842f91e7584561a70e10518eaa645543d3d7a525140f5e26c4e93ea0d
#8 0.318 yarn install v1.22.19
...
#8 ERROR: executor failed running [/bin/sh -c yarn install --frozen-lockfile --production=false --non-interactive]: exit code: 1
------
> [4/4] RUN yarn install --frozen-lockfile --production=false --non-interactive:
------
executor failed running [/bin/sh -c yarn install --frozen-lockfile --production=false --non-interactive]: exit code: 1
我假設sha256:82e644b842f91e7584561a70e10518eaa645543d3d7a525140f5e26c4e93ea0d
是它試圖運行yarn install
的圖像,但是當我嘗試
$ docker run --rm -it --entrypoint sh a45dc5a92caf2f0a57593e5181c60e4fbe1f6a32ae8aa5e1cbaf30a2bd005407 -c '{ command -v zsh && exec zsh -il ;} || { command -v bash && bash -il ;} || { command -v ash && ash -il ;}'
docker: Error response from daemon: No such image: sha256:a45dc5a92caf2f0a57593e5181c60e4fbe1f6a32ae8aa5e1cbaf30a2bd005407.
See 'docker run --help'.
如何在構建失敗之前獲取實際圖像名稱或 hash 以便我可以docker 運行它?
我相信它正在使用 buildkit,但我不確定如何驗證。 我確實想要構建工具包。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.