Setup Jenkins On Docker - Bug Reaper

                  Bug Reaper

Lean about Automation Testing,Selenium WebDriver,RestAssured,Appium,Jenkins,JAVA,API Automation,TestNG,Maven, Rest API, SOAP API,Linux,Maven,Security Testing,Interview Questions

Monday 13 January 2020

Setup Jenkins On Docker

Make sure you Docker Desktop is running


Run PowerShell

Go to https://github.com/jenkinsci/docker

Run Command
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts



Now go to localhost:8080

Paste the password

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword


To Stop Jenkins

Go To Power shell, check all process

PS C:\Users\T460> docker ps                                                                                             CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                              NAMES
05bc013a2bee        jenkins/jenkins:lts   "/sbin/tini -- /usr/…"   30 minutes ago      Up 30 minutes       0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp   happy_aryabhata


Use Command 

docker kill 05bc013a2bee(container-id)

PS C:\Users\T460> docker kill 05bc013a2bee
05bc013a2bee
PS C:\Users\T460> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Now you can see container is not there

If you want to remove the container

PS C:\Users\T460> docker rm  daf99bf847ef
daf99bf847ef


Docker Remove Images

PS C:\Users\T460> docker rmi jenkins/jenkins
Untagged: jenkins/jenkins:latest


How to  Stop the Container

  
PS C:\Users\T460> docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS                                              NAMES
02687b095f08        a3f949e5ebfd        "/sbin/tini -- /usr/…"   8 minutes ago       Up 8 minutes                   0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp   dreamy_elgamal
2588f33ceb4d        hello-world         "/hello"                 About an hour ago   Exited (0) About an hour ago                                                      romantic_mcnulty
0b384abe6696        hello-world         "/hello"                 About an hour ago   Exited (0) About an hour ago                                                      nifty_shockley

PS C:\Users\T460> docker stop dreamy_elgamal
dreamy_elgamal


How to  Start the Container

PS C:\Users\T460> docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
02687b095f08        a3f949e5ebfd        "/sbin/tini -- /usr/…"   9 minutes ago       Exited (143) 17 seconds ago                        dreamy_elgamal
2588f33ceb4d        hello-world         "/hello"                 About an hour ago   Exited (0) About an hour ago                       romantic_mcnulty
0b384abe6696        hello-world         "/hello"                 About an hour ago   Exited (0) About an hour ago                       nifty_shockley

PS C:\Users\T460> docker start dreamy_elgamal

dreamy_elgamal


No comments:

Post a Comment