Docker 无法导入由ctr enc加密的图像

Docker 无法导入由ctr enc加密的图像,docker,azure-container-registry,Docker,Azure Container Registry,我正在尝试使用教程加密docker图像。 我有存储在Azure容器注册表中的图像,我想对它们进行加密 由于ctr enc环境中不支持来自Azure CR的图像,因此我从Azure CR中提取图像,将其标记到本地注册表(sudo docker标记“Azure CR image name”localhost:5000/test:0.1)并推送(sudo docker推送localhost:5000/test:0.1),然后从本地注册表将其从ctr enc中提取 所有的步骤都很好。图像运行成功,因此我

我正在尝试使用教程加密docker图像。 我有存储在Azure容器注册表中的图像,我想对它们进行加密

由于ctr enc环境中不支持来自Azure CR的图像,因此我从Azure CR中提取图像,将其标记到本地注册表(sudo docker标记“Azure CR image name”localhost:5000/test:0.1)并推送(sudo docker推送localhost:5000/test:0.1),然后从本地注册表将其从ctr enc中提取

所有的步骤都很好。图像运行成功,因此我将其导出到tar文件。 当我尝试在任何其他设备中导入tar文件时,会出现错误。 错误如下

unpacking localhost:5000/test:0.1 (sha256:7b60c337c1d319c682369508673f8da65ce027cd95917d80abec71c753f90341)...INFO[0119] apply failure, attempting cleanup             error="failed to extract layer sha256:0447c1aa276497ad5424dd1f8597b7f667126d868489277bab7aea547a4aa982: mount callback failed on /var/lib/containerd/tmpmounts/containerd-mount138280154: archive/tar: invalid tar header: unknown" key="extract-395814385-sMwu sha256:0447c1aa276497ad5424dd1f8597b7f667126d868489277bab7aea547a4aa982"
ctr: failed to extract layer sha256:0447c1aa276497ad5424dd1f8597b7f667126d868489277bab7aea547a4aa982: mount callback failed on /var/lib/containerd/tmpmounts/containerd-mount138280154: archive/tar: invalid tar header: unknown

我只想知道这个流程是否有效,我是否遗漏了什么,或者整个流程都错了。我对此不太了解,因此非常感谢您的帮助。

我通过以下步骤解决了此错误。 尝试重新创建流,我使用链接设置本地存储库。 从acr中提取图像,对其进行加密并将其推送到本地注册表,然后开始将加密图像从本地注册表拉到其他设备

我在设备中发现以下错误

unpacking linux/arm64/v8 sha256:cfd940f7d5d6a6817e8d4f4a811a27263fa11dc00507ebf638ff24be703e5320...
INFO[0293] apply failure, attempting cleanup             error="failed to extract layer sha256:0447c1aa276497ad5424dd1f8597b7f667126d868489277bab7aea547a4aa982: call to DecryptLayer failed: missing private key needed for decryption\n: unknown" key="extract-20510027-zCdy sha256:0447c1aa276497ad5424dd1f8597b7f667126d868489277bab7aea547a4aa982"
ctr: failed to extract layer sha256:0447c1aa276497ad5424dd1f8597b7f667126d868489277bab7aea547a4aa982: call to DecryptLayer failed: missing private key needed for decryption
: unknown
在pull命令本身中提供密钥后,图像被下载,并且运行时没有任何错误。 Pull命令示例:
sudo ctr enc images Pull--plain http=true--key mykey.pem registry.local.com:5000/encrypted image/test:0.1

要点: 1] 在要设置存储库的设备以及要在其中运行加密映像的设备的主机文件中添加以下行。用您的实际IP替换它

Ex:- 192.168.0.1  repository.local.com
2] 在/docker/daemon.json文件中为计划运行加密映像的设备添加以下行

 "insecure-registries":["registry.local.com:5000"]