Docker

How to do docker import export from two AWS Machines ?

AWS, Docker
Step 1: Docker Export in Machine 1: sudo docker export ngjenkins | gzip > ngjenkins.gz Step 2: Run From Machine 1 to copy .gz file to Machine 2: scp -i "my-docker-pair.pem" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ngjenkins.gz ec2-user@YOUR_AWS_HOST_NAME:/home/ec2-user/ .pem file is mandatory to connect with any AWS machine in AWS environments. If you don't have that file in your server, make sure to copy that in your aws machine from your local computer using the below command. scp -i my-docker-pair.pem d:/aws/my-docker-pair.pem ec2-user@YOUR_AWS_HOST_NAME:/home/ec2-user/my-docker-pair.pem Step 3: Docker Import in Machine 2: zcat ngjenkins.gz | docker import - ngjenkins Step 4: Docker Run in Machine 2: docker run -i -t ngjenkins /bin/...

How to change Global Access Control from Google login to jenkins login ?

Docker, Tools
How to change Global Access Control from Google login to jenkins login ? Google login is really helpful to control the jenkins access to specific domain users with secured way. But the problem is if you have not configured your google login properly in jenkins > configure global access > google login, then you will face a login problem. In this case, you will not be able to login to your jenkins dashboard using both "jenkins own database" as well as "google login". <securityRealm class="org.jenkinsci.plugins.googlelogin.GoogleOAuth2SecurityRealm" plugin="google-login@1.5"> <clientId>CLIENT_ID</clientId> <clientSecret>CLIENT_SECRET</clientSecret> <domain>ONLY_DOMAIN_NAMES</domain> </securityRealm> You can find a file named conf...
How to update jenkins in docker container

How to update jenkins in docker container

Docker, Tools
sudo docker container exec -u 0 -it czcjenkins bash here czcjenkins is my container name. wget http://updates.jenkins-ci.org/download/war/2.176.1/jenkins.war This jenkins url can be copied from the official jenkins link or download copy save link from existing jenkins login. mv ./jenkins.war /usr/share/jenkins/ chown jenkins:jenkins /usr/share/jenkins/jenkins.war here jenkins is the user, so keep same as it is only. sudo docker restart czcjenkins

How to install MySQL in Docker ?

Docker
How to install MySQL in Docker ? Installing Particular Version [code] sudo docker pull mysql/mysql-server:5.7 [/code]   Installing Latest Version [code] sudo docker pull mysql [/code]   Running MySql Docker Image: [code] sudo docker run --name mysqlcname -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 --restart always -d mysql [/code] -d => to start it automatically when the server started.     Docker useful commands for Beginners: You can also find other useful docker commands here.
Spring Boot Docker Deployment Steps

Spring Boot Docker Deployment Steps

Docker
Spring Boot Docker Deployment Steps Pre requisite: Install Java. [code] sudo yum install java-1.8.0 sudo yum remove java-1.7.0-openjdk [/code] Install Maven [code] sdk install maven [/code] Note: SDKMan can be used to install the maven. Spring Boot Jar - Docker Deployment Steps: Step 1: Create some folder in your linux machine.[create build folder inside /var] Step 2: Docker deployment file creation Create the below content as Dockerfile: [Filename: Dockerfile without any extension and must be available in "/var/build" path] [code] FROM openjdk:8-jdk-alpine VOLUME /tmp COPY yourjarname-1.0 yourjarname.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/yourjarname.jar"] [/code] Here yourjarname-1.0 is assumed like the ...

Docker commands for new Devops Engineers

Docker
Docker basic commands for beginners: dicker ps To see running docker processes. docker ps -a To see all the docker processes, including stopped ones. docker exec -it czcmysql /bin/bash To login into particular container, here czcmysql is mysql's container name, you can also use container id instead of name to login. docker image ls List all docker images. docker container ls List all docker containers. sudo docker start czcbackend To start a particular docker container, here czcbackend is my container's name. sudo docker stop czcbackend To stop a particular docker container, here czcbackend is my container's name. sudo docker restart czcjenkins To restart a particular docker container, here czcjenkins is my jenkins contai...