Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update or change config manualy #64

Closed
ewookscorp opened this issue Mar 5, 2015 · 9 comments
Closed

Cannot update or change config manualy #64

ewookscorp opened this issue Mar 5, 2015 · 9 comments

Comments

@ewookscorp
Copy link

When access to jenking container example via exec bash enviroment
need root privileges but is not possible.

docker exec -it [container_id] bash

Example there is no sudo or su to root user does not work
su command gives error
su: must be run from a terminal

Sudo or root access is need for make config manualy or update .war file to
container.

@yarikoptic
Copy link
Contributor

export TERM=vt100 would bring piece of those commands needing term

@amouat
Copy link

amouat commented Mar 10, 2015

I use my own build based off Jenkins that gives sudo rights to the jenkins user. The Dockerfile looks like:

FROM jenkins:1.596

USER root
RUN apt-get update \
      && apt-get install -y sudo \
      && rm -rf /var/lib/apt/lists/*
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers

USER jenkins
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt

@ndeloof
Copy link
Contributor

ndeloof commented Mar 24, 2015

You should not update .war file, but just change the docker image version you run.
About configuration, it is all stored in JENKINS_HOME so doesn't need to be root for edition.

@ndeloof ndeloof closed this as completed Mar 24, 2015
@scmgalaxy
Copy link

BTW, I want to install some of the other tools using root or sudo but when i try to login i get the error "su: must be run from a terminal" . How can i get rid of this issues?

@ndeloof
Copy link
Contributor

ndeloof commented Mar 18, 2016

Write a Dockerfile to extend the jenkins one:

FROM jenkins
USER root
CMD install stuff as root
USER jenkins

@adampats
Copy link

FWIW, I was able to work around this (needed to install some tools) by using docker cp from the host - this copies the files as root.

@gbonk
Copy link

gbonk commented Aug 5, 2016

This worked for me

docker exec -u root -it [container_id] bash

@solairerove
Copy link

lol. ty

@scott-sherwood
Copy link

Thanks @gbonk worked a treat

LinuxSuRen pushed a commit to alauda/jenkins-docker that referenced this issue Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants