2017-05-25 46 views
0

我是Docker的新手。我在/bin/bash操作它在我的交互模式的Windows 10 開始詹金斯,我想打開位於/var/jenkins_home/secrets/Docker與Windows

如何打開這個文件的文件InitialAdminPassword

sudo不工作,並且使用apt-get給出了錯誤:

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?

又怎麼找到我的Dockerfile的位置?

回答

0

我不確定,您爲什麼需要Dockerfile的位置。這是一個構建時間的事情,但我認爲你從Docker Hub下載了容器。

jenkins Docker Image刪除權限並執行爲jenkins用戶,這就是爲什麼你不能撥打apt-get

,一方面,啓動容器時,這個祕密發出:

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

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 

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

當您連接到容器,您可以按如下顯示文件內容:

$ docker exec -it <container_id> /bin/bash 
[email protected]<container_id>:/$ cat /var/jenkins_home/secrets/initialAdminPassword 
+0

作品。非常感謝! :) –