Help Center/ Host Security Service/ FAQs/ Container Security/ Failed to Upload the Image to the Private Image Repository
Updated on 2024-11-15 GMT+08:00

Failed to Upload the Image to the Private Image Repository

Symptom

When an on-premises cluster on a private network is connected to HSS, the image fails to be uploaded to the private image repository by running the image upload command in the cluster, and the error message "http: server gave HTTP response to HTTPS client" is displayed, as shown in Figure 1.

Figure 1 Upload failed

Solution

  1. Run the following command to replace docker manifest push --insecure hub.docker.com/1/anp-agent:24.5.0 in the image upload command:

    # Save the manifest description of the image to a JSON file.
    docker manifest inspect {Image repository name}/{Organization name}/{Image name}:{Image tag} >manifest.json

  2. Run the following command to replace docker manifest push --insecure hub.docker.com/1/hostguard:3.2.13 in the image upload command:

    # Run the curl command to push the manifest file to the image repository.
    curl -s -u {Username}:{Password }" -X PUT -H "Content-Type: application/vnd.docker.distribution.manifest.list.v2+json" http://{ image repository name}/v2/{Organization name}/{Image name}/manifests/{Image tag} -T manifest.json

  3. Run the modified image upload command on the cluster node.

    If the command output shown in Figure 2 is displayed, the upload succeeded.

    Figure 2 Image uploaded