2

I have a "docker-jenkins" container with some configured tasks that in the post-build have to run a shell script that move the builded data to a new folder inside the container and then commit to SVN repo.

My problem is that the SH script is executed by "jenkins" user that has not root privileges so my script fails with "permission denied" error.

How can I grant more privileges to jenkins user? Or how can I run the SH script with root privileges?

I'm using Jenkins CI inside a docker container so I suppose that I have to run some docker commands to grant more privileges to jenkins user...

Any ideas?

2
  • 3
    Depending on your container OS, you could install sudo in the container, then add the jenkins user to the sudo group.
    – Zlemini
    Commented Oct 31, 2016 at 13:37
  • 1
    This seems extremely midirected. You migtht want to grant very limited sudo rights to the Jenkins user, but simply making the destination writable by this user seems vastly superior.
    – tripleee
    Commented Oct 3, 2023 at 17:47

1 Answer 1

0

Giving the correct permissions to the destination folder I can solve this kind of problem. SUDO rights are ok too but it could become a security problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.