kush shah
kush shah

Reputation: 27

Docker with Windows

I am new to Docker. I operate it on my Windows 10. Started jenkins in interactive mode at /bin/bash, and i want to open the file InitialAdminPassword located at /var/jenkins_home/secrets/

How do i open this file?

sudo doesn't work, and using apt-get gives the error:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Also how do i find the location of my Dockerfile?

Upvotes: 0

Views: 917

Answers (1)

StephenKing
StephenKing

Reputation: 37600

I'm not sure, why you need the location of the Dockerfile. This is a build-time thing, but I assume you downloaded the container from Docker Hub.

The jenkins Docker Image drops privileges and executes as jenkins user, that's why you can't call apt-get.

On the one hand, this secret is emitted when starting the container:

*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

114439956d184fe2b45e31c9333b9afb

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

*************************************************************

When you attach to the container, you can display the file contents as follows:

$ docker exec -it <container_id> /bin/bash
jenkins@<container_id>:/$ cat /var/jenkins_home/secrets/initialAdminPassword

Upvotes: 1

Related Questions