Hello,
Yes, I’ve recently had to set that up. So far it is working pretty well!
Here’s a link to the official Jenkins image on Docker Hub:
https://hub.docker.com/r/jenkins/jenkins
Note: Make sure NOT to use the deprecated one here:
https://hub.docker.com/r/_/jenkins
Once you have docker installed on your host, all you need to do is to simply run this command:
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
But even better, 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 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
This will automatically create a ‘jenkins_home’ docker volume on the host machine, that will survive the container stop/restart/deletion.
For more information I would also suggest going through the readme file on the official repo here:
https://github.com/jenkinsci/docker/blob/master/README.md
Hope that this helps!
Regards,
Bobby
Everything OK, but I can not run docker command inside the Jenkins!
ever time I run docker version or docker build inside my jenkins job. It throw an error says docker command not found"
Hi @msfayas001,
I can see that you’ve shared a separate question for this, I’ll just share the link so that other community members could have access to the conversation as well:
https://www.digitalocean.com/community/questions/can-not-run-docker-command-inside-the-jenkins
Regards,
Bobby