What is the docker command to run jenkins container in windows
Asked Answered
P

2

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.

Palter answered 20/10, 2016 at 3:21 Comment(3)
Have you tried the examples in the official docs?Fencing
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 windowsPalter
That seems like something someone would have tried before, or asked about it?Fencing
P
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

Princedom answered 20/10, 2016 at 4:18 Comment(0)
P
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

Prier answered 22/2, 2021 at 17:7 Comment(1)
i don't have shared drives or file sharing in my recent docker desktopLancinate

© 2022 - 2024 — McMap. All rights reserved.