forked from pavants52/DevOpsDocs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
How to Install Docker and install Jenkins images using shell script
31 lines (24 loc) · 1.45 KB
/
How to Install Docker and install Jenkins images using shell script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1. Create a file as : vim install_jenkins.sh
2. copy the steps to install Docker and Jenkins image pull as in the link below:
https://github.com/manee2k6/jenkins-course/blob/master/scripts/install_jenkins.sh
3.Open AWS console and configure -->Security groups--> Inbound--> custom TCP --8080 & 50000 port anywhere to be configured.
4.Go to Putty fire a command as : chmod +x install_jenkins.sh
5.Next fire a command as : bash install_jenkins.sh
6.Post installation you will get the ipaddress with port configured successfully. hit the URL.
7.Cat <secret key path>
8.copy paste the key in Jenkins.
Post the above setup stop the docker container: docker stop jenkins
9. git clone https://github.com/manee2k6/jenkins-docker.git
10.cd jenkins-docker
11.ls and build docker image: docker build -t jenkins-docker .
12.docker ps and stop the running old container: docker stop jenkins
13.Remove images: docker rmi -f jenkins.
14.Run the new container:
docker run -p 8080:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --name jenkins -d jenkins-docker
15.docker ps
16. ls -ahl /var/run/docker.sock
17 execute inside the running container: docker exec -it jenkins bash
18.ls -ahl /var/run/docker.sock
19 if bothe step 16 and 18 show result below.
srw-rw---- 1 root docker 0 Feb 5 16:47 /var/run/docker.sock
if step 19 shows docker group then both jenkins container and host docker engine has access to API through unix sock.