๐๐ฎ๐ข๐ฅ๐๐ข๐ง๐ ๐๐/๐๐ ๐๐๐๐ข๐๐ข๐๐ง๐๐ฒ ๐ฐ๐ข๐ญ๐ก ๐๐จ๐๐ค๐๐ซ ๐๐ง๐ ๐๐๐ง๐ค๐ข๐ง๐ฌ
Objective:The objective of this project is to use Docker to create and manage Jenkins containers, emphasizing persistent volumes. This strategy aims to build a robust, scalable Continuous Integration and Continuous Deployment pipeline, showing frequent and reliable deployment of software updates.
Business Problem:A tech company is keen to adopt tools and methodologies that can streamline their operations, improve productivity, and enhance the quality of their applications.
Prerequisites: Have an EC2 instance running and SSH into it(Iโm using VSCODE terminal)
Get Leon B.โs stories inย yourย inbox
Join Medium for free to get updates fromย thisย writer.
๐Documentation on how to build and EC2 instance if needed.Click โก๏ธHere
sudo chmod 666 /var/run/docker.sock๐Lets start of with this command in the terminal because this will allow us to modify our permission to read and write to the Docker socket. This is good for testing and building environments so you donโt have to sudo EVERYTHING!
๐ Weโll pull a Docker image from the registry thatโs much newer and updated.
docker volume create๐ Next, we can create a new volume that will be used by the Docker Containers so it can store persistent data.
docker run -d -v leonvolume201:/var/jenkins_home -p 8080:8080 jenkins/jenkins:lts-jdk17๐This command is running a Jenkins container in the background detached with a data persisting volume. It will be mapped to port 8080 for web access.
docker logs๐ You can run the docker logs command to find the admin password. This will be the password we need in order to access into Jenkins web application.
localhost:8080๐ You can run the localhost command to test the running Jenkins web application and VSCODE will provide a pop-up to open the application.
๐ Paste the password from your terminal onto Jenkins to Unlock and get ready to configure.
๐Create your Admin user.
๐ Lets head over to users in order to create another user so we can test if our data will persist.
๐ Create the User
๐ I created a second container with the same volume. Head back to Jenkins and sign in with the User.
๐ We are back in, this shows use that the data persisted by keeping the data thatโs inside. All we did was keep change the Container and use back the same volume.
๐LinkedIn: https://www.linkedin.com/in/leonboodram/








