The Docker installation documentation describes the steps you need to take to read the password from the console log in the "
Accessing the console logs" section.;
The steps are:
C:\> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7b451848de1d 41f929bb7aef "/sbin/tini -- /usr/…" 8 hours ago Up 8 hours 0.0.0.0:8080->8080/tcp, optimistic_bartik
C:\> docker container logs
optimistic_bartik
The argument to the "docker container logs" command is the value displayed in the "NAMES" column of "docker ps".
C:\> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7b451848de1d 41f929bb7aef "/sbin/tini -- /usr/…" 8 hours ago Up 8 hours 0.0.0.0:8080->8080/tcp, optimistic_bartik
C:\> docker exec
optimistic_bartik
-it bash
Once the bash command prompt is available, you can display the secrets/initialAdminPassword file with 'cat
secrets/initialAdminPassword`
The Docker container image by default does not use /var/lib/jenkins as its home directory. It uses /var/jenkins_home. The steps I listed above will allow you to not need to know which directory is used as the home directory.
Usually we reserve this channel to answer questions related to the creation and maintenance of the Jenkins documentation, rather than questions about using Jenkins. All the best to you!
Mark Waite