Skip to content

Instantly share code, notes, and snippets.

@abola
Last active May 7, 2020 21:32
Show Gist options
  • Save abola/a15461d1717766effe24823786f72110 to your computer and use it in GitHub Desktop.
Save abola/a15461d1717766effe24823786f72110 to your computer and use it in GitHub Desktop.
Install Jenkins with docker on CentOS 7
#!/bin/sh
JENKINS_VERSION="2.0-rc-1"
###
# Automatic install docker with script
# @see <a href="https://docs.docker.com/engine/installation/linux/centos/">Installation on CentOS</a>
##
curl -fsSL https://get.docker.com/ | sh
# start docker.service
systemctl start docker
# pull jenkins image
docker pull jenkinsci/jenkins:$JENKINS_VERSION
# local jenkins home
mkdir -p /var/jenkins
chown 1000 /var/jenkins
# start jenkins as deamon
docker run -d -p 8080:8080 -p 50000:50000 -v /var/jenkins:/var/jenkins_home jenkinsci/jenkins:$JENKINS_VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment