[Docker] 使用 skopeo 複製映像檔時出現 no image found in manifest list for architecture amd64, variant “”, OS darwin?

[Docker] 使用 skopeo 複製映像檔時出現 no image found in manifest list for architecture amd64, variant “”, OS darwin?

之前寫過一篇 使用 skopeo 將遠端 docker registry 映像檔複製到另一個 registry

後來就蠻喜歡用 skopeo 來複製映像檔,

因為少了把映像檔下載到本機再上傳的步驟,方便許多。

 

不過今天想要如法泡製,

把 Prometheus pushgateway 的映像檔推到自己的 repository 時,

卻出現了錯誤訊息:

$ skopeo copy docker://prom/pushgateway:v1.5.1 docker://test.com/infra/prometheus-pushgateway:v1.5.1

FATA[0002] choosing an image from manifest list docker://prom/pushgateway:v1.5.1: no image found in manifest list for architecture amd64, variant "", OS darwin

 

prom/pushgateway 上看了一下,

原來 docker 映像檔給不同的 OS 架構使用時,可以有不同的映像檔:

DIGEST        OS/ARCH       COMPRESSED SIZE 
d6d4f96e3bf9  linux/amd64   10.87 MB
55efaa512227  linux/arm     10.48 MB
f9fe3b14d38a  linux/arm64   10.38 MB
83045d882935  linux/ppc64le 12 MB

 

查了一下,基本上 docker 會自動依據當前 OS 的架構,

來拉取對應的映像檔來使用,

所以當我在 Mac 上用 skopeo 複製映像檔時,

它也試著去抓取 Mac (也就是 Darwin 架構) 的映像檔,但是找不到…

 

解決方法,可以指定 docker 去抓特定 OS 的映像檔,

像是  --override-os linux 指定使用 Linux 的映像檔,這樣就沒問題了:

$ skopeo --override-os linux copy docker://prom/pushgateway:v1.5.1 docker://test.com/infra/prometheus-pushgateway:v1.5.1

Getting image source signatures
Copying blob 22b70bddd3ac done
Copying blob c82d45e6b5e4 done
Copying blob 5c12815fee55 done
Copying blob 669d401920b2 done
Copying config 79a1c88065 done
Writing manifest to image destination
Storing signatures

 

參考資料:

(本頁面已被瀏覽過 88 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料