Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Docker container with root permissions?

I want to build a jenkins docker container with root permissions so that i can us apt-get feature to install gradle.

I am using this command to run jenkins on 8080 port but i also want to add gradle as 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 running at 8080

like image 368
Sidharth Avatar asked Nov 09 '16 12:11

Sidharth


People also ask

Do Docker containers have root access?

Docker containers are designed to be accessed as root users to execute commands that non-root users can't execute.


1 Answers

I am now able to login into my docker container as root and apt-get can be used to install gradle or anything manually into the container.

Command i used to enter as root in container :

docker exec -u 0 -it mycontainer bash
like image 77
Sidharth Avatar answered Oct 09 '22 04:10

Sidharth