1

I have used Jenkins docker image from dockerhub(https://github.com/jenkinsci/docker)

FROM jenkins/jenkins:lts
USER root
ENV http_proxy http://bc-proxy-vip.de.pri.o2.com:8080
ENV https_proxy http://bc-proxy-vip.de.pri.o2.com:8080
RUN apt-get update
RUN apt-get install -y ldap-utils curl wget vim nano sudo
RUN adduser jenkins sudo
User jenkins
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
EXPOSE 8080
EXPOSE 50000

The docker build command was executed successfully and container also started successfully.

Docker build command :

docker build --no-cache -t myjenkins .

Docker container command :

docker run --net=host --name=my_jenkins -d -p 8080:8080 -p 50000:50000 myjenkins

Then I logged in to the container via docker run -it myjenkins bash. I'm unable to find jenkins config files like config.xml, jenkins.xml etc.

user2439278
  • 1,426
  • 7
  • 33
  • 64

1 Answers1

2

I know this is an old issue, but I ran into this recently myself and found that when you run the containerized version of Jenkins, the configuration files are stored in:

/var/jenkins_home

A lot of people seem to be suggesting they're in /etc/sysconfig/jenkins for other Jenkins installs.

Troubadour
  • 49
  • 6
  • 1
    This answer is correct. And you might run into missing editors so you want to check this answer https://stackoverflow.com/questions/30853247/how-do-i-edit-a-file-after-i-shell-to-a-docker-container – newur Mar 11 '19 at 22:29