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,222
  • 7
  • 41
  • 75

1 Answers1

3

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
  • 59
  • 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
  • In the more recent containerized Jenkins releases (v2.375.5) , these files are indeed stored under `/var/jenkins_home` , another alternative method to is to use the variable `${JENKINS_HOME}` which as it new suggests contains the locations of all Jenkins files – rugby2312 Jan 25 '23 at 01:05