简体   繁体   中英

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: 詹金斯我们的任务

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.

在此处输入图像描述

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM