Deploy a Jenkins container on an EC2 instance using Docker by pulling the Jenkins image from Docker Hub, running it as a detached container on port 1001, and accessing the Jenkins UI through the public IP and host port to log in using the initial admin password from the container.
Deploy a Jenkins container on an EC2 instance using Docker by pulling the Jenkins image from Docker Hub, running it as a detached container on port 1001, and accessing the Jenkins UI through the public IP and host port to log in using the initial admin password from the container.
Deploy a Jenkins container on an EC2 instance using Docker by pulling the Jenkins image from Docker Hub, running it as a detached container on port 1001, and accessing the Jenkins UI through the public IP and host port to log in using the initial admin password from the container.
1.Create Ec2 Instance and Security Group using Terraform
2. Connect to EC2 Instance using SSH ssh -i < pem file> ec2-user@publicIP 3. Install Docker Server yum install docker
4. By default Docker server does not start automatically, to start the
service run the below command systemctl start docker 5. check the status of docker whether it is running or not systemctl status docker 6. Take Jenkins Image from Docker hub and run as a container docker run -d jenkins:2.60.3-alpine 7. To check the Docker Images run below command docker images docker ps 8. To access the container outside docker run -d -p <host port: container port > < image : tag> docker run -d -p 1001:8080 jenkins:2.60.3-alpine You should get the Jenkins unlock page 9. Login to Container by using below command docker exec -it <container-id> /bin/bash 10. Get the password of Jenkins cat /var/jenkins_home/secrets/initialAdminPassword
11.Now Access the Jenkins UI using public IP and Host port