原本打算在Docker容器内查看Jenkins的管理员密码,所以准备装个vim,在apt-get的时候报错:
jenkins@409cfd41bc41:/$ apt-get update
Reading package lists... Done
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
这里是权限报错,在exec进来的时候加上 -u 0 即可:
docker exec -u 0 -it MyJenkins bash
然后再执行就没问题了:
apt-get update
apt-get install vim