...
if the Jenkins container is restarting again and again then check the logs using below command
Code Block language bash sudo docker logs --tail 50 –follow --timestamps Jenkins
If the logs are showing like below Wrong volume permissions?
Code Block language bash touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied Can not write to /var/jenkins_home/copy_reference_file.log.
The volume directory /data/jenkins need to be separated with the admin ownership to keep the Jenkins home
Code Block language bash sudo chown 1000 /data/Jenkins
Then run the command: (Now the container is up and running.)
sudo docker ps -a
...
Code Block language bash sudo docker ps -a
Executing into Jenkins container
Code Block language bash sudo docker exec -it jenkins /bin/bash
Inside the Jenkins container, go to /var/Jenkins_home/secrets/ directory. Copy the initial admin password like this
Code Block language bash cat /var/Jenkins_home/secrets/initialAdminPassword