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.