Siddharth Shankar
Siddharth Shankar

Reputation: 539

No Permissions for Jenkins user inside docker container

I am trying to install maven into the docker linux container through a bash shell. I am using jenkinsci/blueocean image. I ran the following command to get the shell to run the commands to install maven: missions for Jenkins us

I am logged in as user jenkins but I do not have the permissions to run any commands. I tried running apt-get and sudo but it says "Permission Denied". I tried updating /etc/group/ but I got the same error. Here is the following commands I tried to make it work.

enter image description here

My main goal is to install maven and java so that I will be able to configure my jenkins. Thanks in advance.

Upvotes: 0

Views: 719

Answers (1)

Adiii
Adiii

Reputation: 60084

First, you need to run the command as a root user.

docker exec --user root -it fad4ff7f84b4 ash

Second, jenkinsci/blueocean image is base on alpine, there is no apt, the package manager for alpine is apk

so you can try

apk add --no-cache your_pacakge
#or
apk add --no-cache maven

Upvotes: 4

Related Questions