Welcome to the Linux Foundation Forum!

Docker Images Name Error and Push to DockerHub Fail

Options

Hi Luis,

I got an error message pushing to Dockerhub in Lab 7, chapter 9, page 11 of the lab (when pushing to registry is added) as follows: (see error at end of message).

this was the message from the build before, which seemed to work:

9 exporting to image

9 exporting layers

9 exporting layers 0.5s done

9 writing image sha256:97464fd7b8adadb872e11517b68530760e5cfc0df46fe27f374a1d1028bc39ea done

#9 naming to docker.io/xxxx/worker:v11 done

9 DONE 0.5s****

THIS WAS THE ERROR AT END OF BUILD AND IMAGES NOT PUSHED TO DOCKERHUB: From the messages i conclude some image validation triggers and maybe prevents the push to the registry. But thats the code from the lab and i doubt there is a mistake (as the image name is being exactly as the code suggests)?

docker.withRegistry('https://index.docker.io/v1/',
'dockerlogin') { def workerImage =
docker.build("xxxxxxxx/worker:v${env.BUILD_ID}", './worker')
workerImage.push('{env.BRANCH_NAME}')
workerImage.push('latest')
}
}
}

Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 470c23a5-79de-4104-93aa-a9ba7d01d6cb
ERROR: Tag must follow the pattern '^:a-zA-Z0-9_{0,127}'
at hudson.util.FormValidation._errorWithMarkup(FormValidation.java:268)
at hudson.util.FormValidation.errorWithMarkup(FormValidation.java:254)
at hudson.util.FormValidation.error(FormValidation.java:145)
at hudson.util.FormValidation.error(FormValidation.java:170)
at org.jenkinsci.plugins.docker.commons.credentials.ImageNameValidator.validateTag(ImageNameValidator.java:244)
at org.jenkinsci.plugins.docker.commons.credentials.ImageNameValidator.validateUserAndRepo(ImageNameValidator.java:116)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:331)
at jdk.internal.reflect.GeneratedMethodAccessor682.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Comments

  • basticloud
    Options

    I am sorry if it looks a it messy. My setup is actually the exact course setup, except the Jenkins Version, which had to be increased due to some error. Thats the only thing I "changed" during lab 1 to 7.

  • basticloud
    Options

    I will try to make it next week on Wednesday to the office hours and in the meantime try to start again with a clean set up. If you have any ideas where to troubleshoot, I am more than happy.

  • luisviveropena
    luisviveropena Posts: 1,158
    Options

    Hi @basticloud,

    I'll see if I can reproduce the issue and I'll let you know.

    I see you on Wednesday!

    Regards,
    Luis.

  • luisviveropena
    luisviveropena Posts: 1,158
    Options

    Hi @basticloud ,

    I found a similar error here:

    https://stackoverflow.com/questions/71610266/name-must-follow-the-pattern-on-jenkins-build

    So, it says it's related to use double quotes when declaring a variable as 'image'. Until this moment, I don't see we are doing that, but I'm still checking.

    Regards,
    Luis.

Categories

Upcoming Training