I have been trying to map volume from my host to docker container, while running jenkins, but failing.
This is what I tried so far:
I executed the following command:
docker run -p 8080:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
I am getting following error:
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
I tried a lot of things, and last I followed the following steps from this link:
Jenkins wrong volume permissions
docker run -p 8080:8080 -p 50000:50000 -it jenkins bin/bash
Once inside the container's shell run the id command and you'll get results like:
uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins)
Exit the container, go to the folder you are trying to map and run:
chown -R 1000:1000 .
On my machine I do not have user 1000 so I am trying to create it but failing to do so.
useradd -u 1000 jenkins
When I run the above command, I get the following error.
useradd: UID 1000 is not unique
My machine details are as follows:
NAME="CentOS Linux"
VERSION="7 (Core)"
The OS is running on Oracle VM Virtual Box.
I have tried couple of other things, but seems to be failing.
Any pointers will be appreciated.
Thanks.