cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to push Built Image to registry

arunanerella
Discoverer

Hi team,

I am trying to build an image using a SAP BTP Container-Based applications pipeline. The job is failing at dockerExecute step with kaniko execution failed error.

I have given my dockerhub credentials, image name and tag correctly but still I am getting the error like below.

kanikoExecute - error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "hub.docker.com/arunanerellamail/spring-petclinic:1.0.0": creating push check transport for hub.docker.com failed: GET https://hub.docker.com/v2/: unsupported status code 404;

I searched couple of articles and most of the articles are referring to kaniko version is causing this issue. Can you please let me know how to resolve this error.

If you can point me to the right page or article which explains the step by step execution of container-based application that would be really helpful.

Many Thanks,

Aruna

Accepted Solutions (0)

Answers (3)

Answers (3)

arunanerella
Discoverer
0 Kudos

Hi Linda,

Please find the details below.

1. Attached full log file.

2. I am using Job Editor configuration mode. Please find the config.yml

---
general:
  buildTool: "docker"
  containerImageName: "arunanerellamail/spring-petclinic"
  containerImageTag: "1.0.0"
  containerRegistryUrl: "https://docker.io"
service:
  automaticVersioning: false
  dockerConfigJsonSecretTextCredentialsId: "dockercredentials"
stages:
  Build:
    kanikoExecute: true
  Acceptance:
    kubernetesDeploy: false
  Release:
    kubernetesDeploy: false 

And I have configured the credentials secret as you mentioned with url https://docker.io

Regarding my docker repository, you are right. it is a private repository.

build-log.txt

Thanks,

Aruna

LindaSieb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aruna,

Thanks for sending me this information. From looking at your log file I can see this error:

"checking push permission for "docker.io/arunanerellamail/spring-petclinic:1.0.0": POST https://index.docker.io/v2/arunanerellamail/spring-petclinic/blobs/uploads/: UNAUTHORIZED: authentication required"

Which looks like the secret you're using is not working. Please try changing the URL of your secret to the following:

https://index.docker.io/v1/

So that your whole secret should look something like this:

{
"auths": {
"https://index.docker.io/v1/": {
"username": "USERNAME",
"password": "PASSWORD_OR_ACCESS_TOKEN"
}
}
}

Thanks and best regards,

Linda

arunanerella
Discoverer
0 Kudos

Hello Linda,

It is not working once again I got kaniko execution failed

Thank you

Aruna

LindaSieb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aruna,

Could you please send some more information about your error? What would be really helpful would be:

1. the full log of the failing run (please make sure to remove any personal data as this is a public website)

2. the exact configuration you used (if you're using the Source Repository configuration mode that would be the .pipeline/config.yml file, or if you're using the Job Editor configuration mode you would click the YML glasses button on your job and paste the yml content here).

Please send both of those things.

Can you confirm that the spring-petclinic repository exists in your arunanerellamail dockerhub account? I don't see it here: https://hub.docker.com/u/arunanerellamail . Is it a private repository?

And can you confirm that you're using https://docker.io as the URL in your secret?

Thanks and best regards,

Linda

LindaSieb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aruna,

I see from your error message that hub.docker.com is part of your image name which I think could be the problem here. Could you please try entering the following parameters for your job?

Container Registry URL: https://docker.io

Container Image Name: arunanerellamail/spring-petclinic

Container Image Tag: 1.0.0

And please make sure that your Container Registry Credentials are created as per these specifications

To authenticate your pipeline against your container image repository, create a Secret Text credential of a user, who has the appropriate permissions. See Creating Credentials.

In the Secret field, enter the following code and replace the placeholders in brackets with your actual values:

{
  "auths": {
    "https://docker.io": {
      "username": "USERNAME",
      "password": "PASSWORD_OR_ACCESS_TOKEN"
    }
  }
}

"USERNAME" is your container registry username and "PASSWORD_OR_ACCESS_TOKEN" corresponds to your password or access token.

Choose this credential from the dropdown list.

(The section above was taken from this documentation, with a few edits for clarity: https://help.sap.com/docs/CONTINUOUS_DELIVERY/99c72101f7ee40d0b2deb4df72ba1ad3/87cf47a7820d4a00abd8a...

And here is the general documentation on setting up the Container-Based Applications pipeline in the Job Editor:

https://help.sap.com/docs/CONTINUOUS_DELIVERY/99c72101f7ee40d0b2deb4df72ba1ad3/87cf47a7820d4a00abd8a...

I hope this helps! Please let me know if it's still not working.

Thanks and best regards,

Linda Siebert