[英]Docker ; Wrong volume permissions?
I pulled a Jenkins official image in docker and want to start the jenkins container but It seems I have a permission problem which I really did not understant despite I find the same issue in the net but they doesn't helped me to fix my issue.我在 docker 中拉了一个 Jenkins 官方镜像,想启动 jenkins 容器,但似乎我有一个权限问题,尽管我在网上发现了同样的问题,但我真的没有理解这个问题,但他们没有帮助我解决我的问题。 I want to start the jenkins container with this command
docker compose up -d
but I got this issue:我想用这个命令 docker
docker compose up -d
启动 jenkins 容器,但我遇到了这个问题:
Creating jenkins_Container ... done
Attaching to jenkins_Container
jenkins_Container | touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
jenkins_Container | Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
jenkins_Container exited with code 1
Here is my docker-compose.yml:这是我的 docker-compose.yml:
version: '3'
services:
jenkins:
container_name: jenkins_Container
image: docker.io/jenkins/jenkins
ports:
- '8080:8080'
volumes:
- '$PWD/jenkins_Home:/var/jenkins_home'
networks:
- net
networks:
net:
any suggestion is appreciated...任何建议表示赞赏...
Regards问候
after some research this solved my problem by running this command :经过一些研究,这通过运行以下命令解决了我的问题:
docker run -d -p 49001:8080 -v $PWD/jenkins_Home:/var/jenkins_home:z -t docker.io/jenkins/jenkins
got it from Running Jenkins in Docker - Exits immediately从在 Docker 中运行 Jenkins得到它- 立即退出
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.