docker 不同架构镜像融合问题解决

 1、背景

docker 作为目前容器的标准之一,但是对于多种架构的平台的混合编译支撑不是很好。因此衍生了镜像融合,分别将多种不同的架构构建好,然后将镜像进行融合上传。拉取镜像的会根据当前系统的架构拉取不同的镜像,也可以通过 --platform 指定什么类型的架构。

2、处理流程

注意:这里使用的 http 类型的 harbar 服务,如果不是请去除参数 --insecure

# 构建 arm 镜像
docker build -t registry.xx/public/test-arm:v1.0 -f test-arm.Dockerfile
# 构建 amd 镜像
docker build -t registry.xx/public/test-amd:v1.0 -f test-amd.Dockerfile
# 镜像融合
docker manifest create --insecure --amend registry.xx/public/test:v1.0 registry.xx/public/test-arm:v1.0 registry.xx/public/test-amd:v1.0
# 镜像上传
docker manifest push --insecure registry.xx/public/test:v1.0

3、问题

3.1 docker manifest create is only supported on a Docker cli with experimental cli features enabled

需要开启参数 experimental,只有 docker v20.xx.xx 版本之前的需要,后续版本默认开启该参数。

需要在两个地方加上参数

[root~]# cat /etc/docker/daemon.json
{
    
    "insecure-registries" : ["registry.xx"],
    "experimental": true
}

[root~]# cat ~/.docker/config.json
{
	"auths": {
		"registry.xx": {
			"auth": "xxxxxx"
		}
	},
	"experimental": "enabled"
}[ro

3.2 failed to configure transport: error pinging v2 registry: Get https://registry.xx/v2/: http: server gave HTTP response to HTTPS client

如果使用的是 https 的 harbor 则没有下面问题

docker 20.xx.xx 版本存在如下bug

https://github.com/docker/cli/pull/2376

请将docker 版本升级到 20.xx.xx 或者以上

相关推荐

  1. docker镜像如何在不同架构上运行】

    2024-03-23 07:02:01       23 阅读
  2. 解决docker拉取镜像错误 missing signature key 问题

    2024-03-23 07:02:01       58 阅读
  3. 如何解决Docker镜像仓库认证失败的问题

    2024-03-23 07:02:01       34 阅读
  4. 【打工日常】解决docker镜像pull的很慢的问题

    2024-03-23 07:02:01       34 阅读
  5. 2024年6月关于docker拉取镜像超时失败问题解决

    2024-03-23 07:02:01       32 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-23 07:02:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-23 07:02:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-23 07:02:01       87 阅读
  4. Python语言-面向对象

    2024-03-23 07:02:01       96 阅读

热门阅读

  1. 1. 控制系统

    2024-03-23 07:02:01       34 阅读
  2. pta 7-31 字符串循环左移 C语言

    2024-03-23 07:02:01       33 阅读
  3. 关于Pyqt更换资源内容运行软件不生效的解决办法

    2024-03-23 07:02:01       36 阅读
  4. Elasticsearch 的 scroll API

    2024-03-23 07:02:01       36 阅读
  5. nju cs上机

    2024-03-23 07:02:01       43 阅读
  6. 路漫漫其修远兮,吾将上下而求索

    2024-03-23 07:02:01       45 阅读
  7. 十一.matplotlib可视化

    2024-03-23 07:02:01       39 阅读
  8. 正则表达式

    2024-03-23 07:02:01       36 阅读
  9. opencv模板匹配

    2024-03-23 07:02:01       45 阅读