Docker Community Forums

Share and learn in the Docker community.

Launching Jenkins image


(Jokrasa) #1

I’m trying to run the Jenkins image and of course i’m getting stuck with the installation password.

docker pull jenkins <-- installs the latest version OK

if I run
docker run -d -p 8080:8080 jenkins

I can see and paste in the hashcode password
(carefully without ctr-c stopping the console password)

but when I close the console it kills the server and I have to start all over again.

If I run as -d detatched (Daemon) it would keep running but I cannot see the
initial hashcode password.

here I try to see the password in the hosts /home/ec2-user/jenkins folder
but when i run this command

docker run -p 8080:8080 -p 50000:50000 -v /home/ec2-user/jenkins:/var/jenkins_home jenkins

I get… ( even if I run it as sudo or add --pivileged )

touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?

What command would allow the jenkins image to keep running in my docker service
and allow me to see the initial password to run jenkins ?

Does someone have a script (dockerfile to run jenkins in docker ? )


(Think) #2

start it with -d and check the password with docker logs for example.
but keep in mind that all of this should just be a temporary solution.

(Jokrasa) #3

Thanks !

Yes I found that… docker logs container#

Gave the console output where I could read the hashcoded password :sunglasses:

(Nhudeck) #4

You should be able to find the initial password with:
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

(Zpalazov) #5

Thanks for me docker logs doesn’t show any password just the server startup log,
I am using this repo jenkins/jenkins:2.141-alpine