Jenkins Docker container with root privileges?

I want to create a docker jenkins root container so that I can use apt-get to install gradle.

I use this command to run jenkins on port 8080, but I also want to add gradle as an enviornment variable:

docker run -p 8080:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home jenkins

or what dockerfile i need to create and what to write in it so that jenkins also start working on 8080

+10
source share
2 answers

Now I can log into my docker container as root, and apt-get can be used to install gradle or something else manually in the container.

The command I used to log in as the root user in the container:

docker exec -u 0 -it mycontainer bash
+33

, USER root, root.

Dockerfile

FROM jenkins/jenkins

USER root

( ):

docker exec -it jenkins_jenkins_1 bash
root@9e8f16419754:/$
0

Source: https://habr.com/ru/post/1660286/


All Articles