6

What is the correct docker run ... command to run jenkins container.

  1. What are the required ports?
  2. How to mount volume D:\jenkins folder to jenkins job configuration path?

I'm using linux containers on windows 10.

sithumc
  • 3,254
  • 8
  • 27
  • 46
  • Have you tried the examples in the [official docs](https://hub.docker.com/_/jenkins/)? – Roman Oct 20 '16 at 03:39
  • docker run -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home jenkins. How to mount D:\jenkins folder instead /your/home. Linux notation doesn't work in windows – sithumc Oct 20 '16 at 03:52
  • That seems like something someone would have tried before, or [asked about it?](http://stackoverflow.com/questions/33126271/how-to-use-volume-option-with-docker-toolbox-on-windows/39181789#39181789) – Roman Oct 20 '16 at 05:02

2 Answers2

5
docker run -p 8080:8080 -p 50000:50000 -v //D/jenkins:/var/jenkins_home jenkins

or with : -v D:/jenkins:/var/jenkins_home like in example below but i personally prefer first approach.

just make sure in docker settings you have checked disc D to allow mounting D

Share Drives settings example

VladoDemcak
  • 4,893
  • 4
  • 35
  • 42
0

UPDATE for new docker-for-windows versions:

Make sure under Docker Settings > Resources > FILE SHARING,
The host path exists in this list, else you should add it.

In your example, you should check D:\jenkins

Ahmed Nabil
  • 17,392
  • 11
  • 61
  • 88