I have a docker container, on which I am running jenkins, so its on my localhost, currently on 127.0.0.1:xxxx jenkins is running. how can I set a static ip where I can run my jenkins. eg: 172.22.xx.xx:port_addr where my jenkins will run.
Asked
Active
Viewed 101 times
0
-
if you the machine you deployed Jenkins on is accessible from network/internet you are good, all you have todo is publish the port to the host machine then it will be available, if that's your question. – ROOT Mar 10 '20 at 12:20
-
my jenkins is running on my localhost, its not open on internet. – Mrutyunjay Acharya Mar 11 '20 at 07:23
-
1does this help: https://stackoverflow.com/questions/27937185/assign-static-ip-to-docker-container – ROOT Mar 11 '20 at 07:29
-
Why do you want to have static IP? If you want other containers in your host (the same host as your Jenkins container) to access Jenkins, then you can use container linking, even better you can use docker-compose. If you want Jenkins to be accessible for other users outside localhost, then publish the port as @Ma'mounothman said. There is probably no need for a static IP. – gregory112 Mar 11 '20 at 08:34
-
How can I publish the port to host machine? – Mrutyunjay Acharya Mar 12 '20 at 05:00