Gautam Banerjee
Gautam Banerjee

Reputation: 11

Jenkins job build error | Trying to build docker image | Jenkins and Docker both are installed in Windows 7

I have installed docker toolbox and Jenkins on my windows 7 laptop (virtualization enabled), and I'm trying to build a Jenkins job for creating and deploying an Angular image. However, its working fine when I try using windows commands line but its showing below error when I try to build the project.

C:\Program Files (x86)\Jenkins\workspace\MyDemo>docker run --rm -p 4200:4200 --name "TopMovies1" demoapp1 
'docker' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files (x86)\Jenkins\workspace\MyDemo>exit 9009 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

**PS out put from windows command line ****

C:\Users\gbanerje>docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

FYI, I have added "C:\Program Files\Docker Toolbox;C:\Windows\System32" in the path varialble but still the error persist.

Please share if we have any clue on this error.

Thank you in advance.

Upvotes: 0

Views: 580

Answers (3)

pelos
pelos

Reputation: 1876

if you can run the docker from the command line but not from Jenkins job, you might need to change the order on how the environment are. you might want to move the docker path all the way down, and let grab the system Windows/linux variables first.

Upvotes: 0

Gautam Banerjee
Gautam Banerjee

Reputation: 11

try to add the above paths in environment variable section in manage jenkins -> configure system -> Environment Variables and add path=%path%;

Upvotes: 1

Amit Nanaware
Amit Nanaware

Reputation: 3356

try to add the above paths in environment variable section in manage jenkins -> configure system -> Environment Variables and add path=%path%;

Upvotes: 1

Related Questions