
# 上传镜像到私有镜像仓失败
#### 问题现象
私网自建集群接入HSS过程中，在集群上执行镜像上传命令上传镜像到私有镜像仓失败，报错"http: server gave HTTP response to HTTPS client"，如[图 上传失败]所示。
图1上传失败   
![](https://support.huaweicloud.com/hss2.0_faq/zh-cn_image_0000002041866857.png "点击放大")
#### 解决办法
1. 使用如下命令，替换镜像上传命令中的"docker manifest push --insecure hub.docker.com/1/anp-agent:24.5.0"部分。 
   ```
   # 保存镜像的manifest描述到JSON文件中
   docker manifest inspect {镜像仓名称}/{组织名称}/{镜像名称}:{镜像版本} >manifest.json
   ```
   
   
2. 使用如下命令，替换镜像上传命令中的"docker manifest push --insecure hub.docker.com/1/hostguard:3.2.13"部分。 
   ```
   # 通过curl命令将manifest文件推送到镜像仓
   curl -s -u "{用户名}:{密码}" -X PUT -H "Content-Type: application/vnd.docker.distribution.manifest.list.v2+json" http://{镜像仓名称}/v2/{组织名称}/{镜像名称}/manifests/{镜像版本} -T manifest.json
   ```
   
   
3. 在集群节点上执行修改过的镜像上传命令。 
   命令执行后界面回显如[图 镜像仓上传成功]所示，表示上传成功。
   图2镜像仓上传成功   
   ![](https://support.huaweicloud.com/hss2.0_faq/zh-cn_image_0000002043500513.png "点击放大")
   
   
