Welcome to the Linux Foundation Forum!

Lab 6 - docker in docker certificate error

Hello,

I'm having some trouble with lab 6 in the first exercise - I have updated my worker Jenkinsfile to use the docker agent, pulling the maven docker image.
However when Jenkins attempts to run the build it gets certificate errors (excerpt below). It looks to me like the dind container is running with a different timestamp than my host system time or the jenkins container time (I have run bash on the Jenkins container to check but there is no bash on the dind container) - I'm not sure how to fix this. Is it possible to flag the build to ignore certificate errors?
I have been googling but it is a subject full of answers that are unrelated to my problem, any help would be appreciated.

Thanks

Excerpt from logs, can add the whole log if needed.

+ docker inspect -f . maven:3.6.1-jdk-8-slim

error during connect: Get "https://docker:2376/v1.45/containers/maven:3.6.1-jdk-8-slim/json": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time 2024-05-29T23:20:56Z is before 2024-05-30T07:29:24Z
[Pipeline] isUnix
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ docker pull maven:3.6.1-jdk-8-slim
error during connect: Post "https://docker:2376/v1.45/images/create?fromImage=maven&tag=3.6.1-jdk-8-slim": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time 2024-05-29T23:20:57Z is before 2024-05-30T07:29:24Z

Best Answers

Answers

  • paulkx
    paulkx Posts: 7
    edited May 29

    I was mistaken, I have gotten a shell into the dind container and the date command returns the host system time so I am not sure what is causing the certificate error

  • luisviveropena
    luisviveropena Posts: 1,233

    Hi @paulkx.

    Bringing the containers down and up again seems to have done the trick.

    Well, it seems you were able to fix it.

    Regards,
    Luis.

Categories

Upcoming Training