0

I am trying to run Jenkins in a docker container on my Windows 10 box. I am using a Windows container, not a Linux container.

I tried to use this guide: https://jenkins.io/doc/book/installing/#on-windows However the command to enter is for Linux containers, not Windows containers.

I can't seem to get Linux containers to work due to a known issue with them after the 1709 update (https://github.com/docker/for-win/issues/1221).

I tried "docker pull jenkins" however there's no amd64 version to pull.

Any ideas here? My only other thought is trying to figure out how to run Java from a windows container so I can use the Jenkins .war file instead?

newdevt
  • 9
  • 1
  • 1
  • 5

1 Answers1

6

Actually, I was able to run Jenkins Linux container on my Windows (Build 1709) machine. However, this version of Windows and Docker (17.12.0) run Linux Containers on top of Hyper-V. So you need to enable Hyper-V before taking the following steps.

  1. Right-click on the whale icon and click on Switch To Linux Containers
  2. run docker pull jenkins/jenkins:lts in Powershell
  3. run docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts in Powershell
  4. Get The IP of your container and use your browser to open Jenkins Panel on port 8080.

Besides that, I found there are several Jenkins Windows Images. Such as:

  1. https://www.assistanz.com/installing-jenkins-through-docker-file-for-windows-container/
  2. https://asmagin.com/2017/05/02/jenkins-on-docker-for-net-projects/
Ehsan Mirsaeedi
  • 6,924
  • 1
  • 41
  • 46
  • **Get The IP of your container** : if you are exposing port 8080 then your localhost should able to access it right? – Nikhil Aug 11 '18 at 03:54
  • 1
    @Nikhil It's not always the case in Windows. https://stackoverflow.com/questions/44810075/why-cant-i-ping-docker-container/48289654#48289654 – Ehsan Mirsaeedi Aug 28 '18 at 14:26
  • This was amazingly easy on windows 10 and the Docker 17.12 -- I wouldn't have even thought to try! – Yablargo Aug 29 '18 at 03:20
  • while running on windows 10 i get following error can you please explain this . PS C:\Users\avs01\Desktop> docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint loving_lederberg (1deab10f087591bb3d44d9bdc29f28d2a3772b60d8490d197fac2a54d5d12bb4): Error starting userland proxy: Bind for 0.0.0.0:50000: unexpected error Permission denied. – Bhagvat Lande Feb 13 '19 at 08:07
  • @EhsanMirsaeedi Not for me - it fails https://stackoverflow.com/questions/66017071/jenkins-dashboard-does-not-show-at-localhost8080-when-launched-from-windows-doc – likejudo Feb 03 '21 at 03:47