Thursday, 17 February 2022

How to Connect to a running container- Unlock Jenkins Password in Docker

 Prerequisite:

Make sure you complete this lab: https:/www.devopstreams.com/2022/02/how-to-pull-images-from-docker.html before attempting this


You can connect to a running container just like you can connect to a server and then run commands in that container. To do that you have to make use of the docker exec command

Step 1: Create a Container from a Jenkins image. see https:/www.devopstreams.com/2022/02/how-to-pull-images-from-docker.html

Step 2: Lunch another terminal on your docker host( Separate from the one you used on step1)

Step 3. Connect to your running container 

docker exec -it container_id sh--------->replace ur container id in red

docker exec -it 65357f31b2bc sh



This will connect you to the shell of the container.
Step 3: Unlock Jenkins : Now you are connected to the container shell, you can access the path of the Jenkin initial password



Step 4: Unlock Jenkins in the UI





No comments:

Post a Comment

How to upgrade Maven

  java.lang.IllegalStateException I had installed maven in my ubuntu using command  apt install maven This installed maven in path /usr/shar...