The Jenkins Continuous Integration and Delivery server available on Docker Hub.
This is a fully functional Jenkins server. https://jenkins.io/. Jenkins War Packages: https://get.jenkins.io/war/
docker run -p 8080:8080 -p 50000:50000 --restart=on-failure nqdev/jenkins:lts-jdk21
NOTE: read the section Connecting agents below for the role of the 50000 port mapping.
NOTE: read the section DNS Configuration in case you see the message "This Jenkins instance appears to be offline."
This will store the workspace in /var/jenkins_home.
All Jenkins data lives in there - including plugins and configuration.
You will probably want to make that an explicit volume so you can manage it and attach to another container for upgrades :
docker run -p 8080:8080 -p 50000:50000 --restart=on-failure -v jenkins_home:/var/jenkins_home nqdev/jenkins:lts-jdk21
This will automatically create a 'jenkins_home' docker volume on the host machine. Docker volumes retain their content even when the container is stopped, started, or deleted.
NOTE: Avoid using a bind mount from a folder on the host machine into /var/jenkins_home, as this might result in file permission issues (the user used inside the container might not have rights to the folder on the host machine).
If you really need to bind mount jenkins_home, ensure that the directory on the host is accessible by the jenkins user inside the container (jenkins user - uid 1000) or use -u some_other_user parameter with docker run.
docker run -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 --restart=on-failure nqdev/jenkins:lts-jdk21
This will run Jenkins in detached mode with port forwarding and volume added. You can access logs with command 'docker logs CONTAINER_ID' in order to check first login token. ID of container will be returned from output of command above.
Or, directly print the initial admin password using:
docker exec <jenkins_container_id_or_name> cat /var/jenkins_home/secrets/initialAdminPassword
Replace <jenkins_container_id_or_name> with your actual Jenkins container id or name.
To access Jenkins and complete the initial setup, follow the instructions in the installation guide.
Content type
Image
Digest
sha256:06bc5027a…
Size
235.9 MB
Last updated
8 months ago
docker pull nqdev/jenkins