docker icon indicating copy to clipboard operation
docker copied to clipboard

jenkinsci/jenkins:2.89 root password

Open arsenalpoll opened this issue 8 years ago • 15 comments

hi ; $apt-get install rsync E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

What is the root password?

arsenalpoll avatar Feb 01 '18 01:02 arsenalpoll

use USER ROOT in the dockerfile before the apt install line and move back to USER JENKINS right after.

Chrislevi avatar Feb 04 '18 12:02 Chrislevi

thanks you

arsenalpoll avatar Feb 04 '18 13:02 arsenalpoll

on the same topic I guess, I am trying to install pip on the container and here is the error:

apt install python3-pip E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

eventually I intend to install aws cli

any idea on how to run as root please, if I try su root I am asked for a password.

mihaiwww avatar Feb 04 '18 16:02 mihaiwww

use USER ROOT in the dockerfile before the apt install line and move back to USER JENKINS right after.

the dockerfile add

RUN apt install python3-pip -y

| | 彩虹 邮箱:[email protected] |

签名由 网易邮箱大师 定制

On 02/05/2018 00:38, mihaiwww wrote:

on the same topic I guess, I am trying to install pip on the container and here is the error:

apt install python3-pip E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

eventually I intend to install aws cli

any idea on how to run as root please, if I try su root I am asked for a password.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

arsenalpoll avatar Feb 04 '18 16:02 arsenalpoll

thanks @arsenalpoll but I still have some issues.

Here is my Dockerfile: FROM jenkins/jenkins:lts USER root RUN apt install python3-pip -y USER JENKINS EXPOSE 8080

When running with docker build .

I get an error: Sending build context to Docker daemon 2.048kB Step 1/5 : FROM jenkins/jenkins:lts ---> 279f21046a63 Step 2/5 : USER root ---> Using cache ---> c16e9582c153 Step 3/5 : RUN apt install python3-pip -y ---> Running in c70d1067399c

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package python3-pip The command '/bin/sh -c apt install python3-pip -y' returned a non-zero code: 100

In docker file if I use USER ROOT instead of USER root it does not work with build error: linux spec user: unable to find user ROOT: no matching entries in passwd file

mihaiwww avatar Feb 04 '18 16:02 mihaiwww

You may try

RUN apt update

before RUN apt install ...

gmacario avatar Feb 04 '18 17:02 gmacario

you need
RUN apt-get update
RUN apt install python3-pip -y

| | 彩虹 邮箱:[email protected] |

签名由 网易邮箱大师 定制

On 02/05/2018 00:55, mihaiwww wrote:

thanks @arsenalpoll but I still have some issues.

Here is my Dockerfile: FROM jenkins/jenkins:lts USER root RUN apt install python3-pip -y USER JENKINS EXPOSE 8080

When running with docker build .

I get an error: Sending build context to Docker daemon 2.048kB Step 1/5 : FROM jenkins/jenkins:lts ---> 279f21046a63 Step 2/5 : USER root ---> Using cache ---> c16e9582c153 Step 3/5 : RUN apt install python3-pip -y ---> Running in c70d1067399c

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package python3-pip The command '/bin/sh -c apt install python3-pip -y' returned a non-zero code: 100

In docker file if I use USER ROOT instead of USER root it does not work with build error: linux spec user: unable to find user ROOT: no matching entries in passwd file

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

arsenalpoll avatar Feb 04 '18 17:02 arsenalpoll

thank you @arsenalpoll and @gmacario worked like a charm... completely forgot about apt-get update.

I am just wondering if there is any way to use root user when hooking into the container with docker exec -it <container id> bash to test out stuff before placing it in Dockerfile

mihaiwww avatar Feb 04 '18 17:02 mihaiwww

the Dockerfile use user jenkins start jenkins,so do not root apt install .if use ROOT start jenkins the docker exec ..... bash is root

| | 彩虹 邮箱:[email protected] |

签名由 网易邮箱大师 定制

On 02/05/2018 01:07, mihaiwww wrote:

thank you @arsenalpoll and @gmacario worked like a charm... completely forgot about apt-get update.

I am just wondering if there is any way to use root user when hooking into the container with docker exec -it bash to test out stuff before placing it in Dockerfile

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

arsenalpoll avatar Feb 04 '18 17:02 arsenalpoll

sorry @arsenalpoll , I cannot follow,

basically I am trying to install aws cli on the container but I still get some error on Dockerfile. I'll post the Dockerfile below if anyone have an idea. Not really the main topic of this ticket, If anyone concerned I can open another topic on this.

FROM jenkins/jenkins:lts USER root RUN apt-get update RUN apt install python3-pip -y RUN pip3 install awscli --upgrade --user RUN whoami USER jenkins RUN aws --version EXPOSE 8080

/bin/sh: 1: aws: not found same it happens if I run before moving to jenkins user back.

mihaiwww avatar Feb 04 '18 17:02 mihaiwww

got, it, dropped the --user option in pip3 install

mihaiwww avatar Feb 04 '18 17:02 mihaiwww

please do not ask questions in the issue tracker, use the mailing lists

There is no root password in containers

Docs on installing tools https://github.com/jenkinsci/docker#installing-more-tools

carlossg avatar Feb 05 '18 10:02 carlossg

@arsenalpoll docker exec --user root -it jenkins bash

mwasilew2 avatar Mar 20 '18 10:03 mwasilew2

@arsenalpoll docker exec --user root -it jenkins bash

It worked. Thanks

raghureddycloud avatar Jun 18 '19 07:06 raghureddycloud

@arsenalpoll docker exec --user root -it jenkins bash

Thank you very much, it helped a lot.

deeptechs avatar Aug 07 '19 10:08 deeptechs