I am trying to configure docker to read my dockerfile and get executed in the docker’s build pipeline. In the Configuration Tools section I have defined
but cannot reach to docker and it gives this following error My actual path in the environment variables in Windows is set as : C:\Program Files\Docker\Docker\resources\bin but this is taking some path always starting from C:\ProgramData\Jenkins.jenkins\tools\hudson, Don’t know why?
$ docker login -u eagertolearn001 -p ******** https://index.docker.io/v1/
exec: "com.docker.cli.exe": executable file not found in %PATH%
Current PATH : C:\ProgramData\Jenkins\.jenkins\tools\hudson.model.JDK\Java17/bin;C:\ProgramData\Jenkins\.jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven3/bin;C:\ProgramData\Jenkins\.jenkins\tools\hudson.model.JDK\Java17/bin;C:\ProgramData\Jenkins\.jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven3/bin;C:\WINDOWS\SYSTEM32;C:\Program Files\Jenkins
[Pipeline] // withDockerRegistry
Any help will be greatly appreciated.
Sincere Regards
EagerToLearn
eagertolearn001:
Current PATH : C:\ProgramData\Jenkins\.jenkins\tools\hudson.model.JDK\Java17/bin;C:\ProgramData\Jenkins\.jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven3/bin;C:\ProgramData\Jenkins\.jenkins\tools\hudson.model.JDK\Java17/bin;C:\ProgramData\Jenkins\.jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven3/bin;C:\WINDOWS\SYSTEM32;C:\Program Files\Jenkins
[Pipeline] // withDockerRegistry
Looks like „C:\Program Files\Docker\Docker\resources\bin“ is not defined in the PATH environment variable.
Is it defined under: Manage Jenkins → Configure System → Global properties → Environment variables ?
As you said, now I have defined it like this:
$ docker login -u eagertolearn001 -p ******** https://index.docker.io/v1/
exec: “com.docker.cli.exe”: executable file not found in %PATH%
Current PATH : C:\ProgramData\Jenkins.jenkins\tools\hudson.model.JDK\Java17/bin;C:\ProgramData\Jenkins.jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven3/bin;C:\Program Files\Docker\Docker\resources\bin/bin;C:\ProgramData\Jenkins.jenkins\tools\hudson.model.JDK\Java17/bin;C:\ProgramData\Jenkins.jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven3/bin;C:\Program Files\Docker\Docker\resources\bin/bin;C:\WINDOWS\SYSTEM32;C:\Program Files\Jenkins
I am not able to run docker from jenkins pipeline. What should I do?
It is showing the path like this: C:\Program Files\Docker\Docker\resources\bin/bin;
What should be the configuration in the Manage Jenkins > Tools?
What should be the configuration in the Manage Jenkins > System?
Sincere Regards
EagerToLearn
As far as I know, you should only add paths and not files into the PATH environment variable.
It is not clear to me where the second /bin path comes from.
I would look for a corresponding entry with /bin in the configuration and otherwise pragmatically try to adjust the PATH environment variable to “C:\Program Files\Docker\Docker\resources”.
But I am not an expert for Jenkins, so it would be better to ask your question in a forum for Jenkins.