在docker下拉取jenkins镜像后,build 并 run 之后通过 docker exec it [containerID] /bin/bash 命令进入镜像后,再执行docker images命令提示权限不够:Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.29/images/json: dial unix /var/run/docker.sock: connect: permission denied。此时执行su命令想获得权限发现所有密码都是不对的。我的Dockerfile文件内容:FROM jenkins:alpineUSER rootRUN curl -O https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz \
&& tar zxvf docker-latest.tgz \
&& cp docker/docker /usr/local/bin/ \
&& rm -rf docker docker-latest.tgzARG DOCKER_GID=999USER jenkins:${DOCKER_GID}我的docker run命令:docker run -p 49002:8080 --name jenkins_docker -d -v /Users/UserName/jenkins_docker:/var/jenkins_home -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock jenkins_docker
- 2 回答
- 0 关注
- 6161 浏览
添加回答
举报
0/150
提交
取消