Monday, September 16, 2019

PUSH/PULL Docker Image form Private Repository (Nexus) - Mithun Technologies +91-9980923226

PUSH/PULL Docker Image form Private Repository (Nexus)


Pre-Requisities:
Server 1: Ubuntu                                         Server 2: Ubuntu
Install the below softwares in Server1          Install the below softwares in Server2
Java 8                                                              Docker

Docker

Jenkins

Maven/Gradle
Server 1:
1   We are going to build our project using maven/gradle
2   Through docker file we are going to create an docker image for that project
  We are going to push the docker image to Nexus (docker hosted) repo
Server 2:
We are going to pull the docker image form Nexus (docker hosted) repo
2   Create a container using the docker image
Nexus Repository (docker hosted,proxy) Creation:
docker hosted:   
1) Login to your Nexus repository.
2) Create docker hosted


 Here give a name to the repo (dock-hosted), then we are going to assign a port to this docker hosted repo. Through this port we are going to access this repo. (Note: you should not give 8081 because it is already assigned to Nexus Repo, so use different port number)

In this case I have assigned 8083 for this repo.

3) Keep the remaining settings as it is and create repository




 Note: Open 8083 in AWS Security Groups.
Ubuntu Configuration : Server 1 & 2
Do these steps in both the servers in order to push and pull docker images from Nexus Repo.
1.     Login as root user
2.     Go to /etc/docker
            cd /etc/docker
3.     Then create a file called daemon.json
vi /etc/docker/daemon.json
4.     Write these script in daemon.json

{
  "insecure-registries": [ "13.234.21.143:8083" ]
}

(Here we are allowing our docker daemon to access the Nexus Hosted Repo)
5.     Save the file
6.     Restart docker service using below command.
            systemctl restart docker

 
Server 1: Login,Build & Push
1 Login to Nexus repo
docker login –u admin –p password 13.234.21.143:8083
(or)
docker login 13.234.21.143:8083



Build an image using below command.
docker build –t 13.234.21.143:8083/image1 .
           
(here while building an docker image we will use ip address with port for the docked hosted repo instead of username in hub.docker.com)


 
3 Push docker image to Nexus Repo



Server 2: Pull image/Run container
1.     Login to Nexus

2   Pull docker image

 
Build a container
docker run –d –p 8090:8080 –p 9990:9990 - -name wildfly 13.234.21.143:8083/image1
(I am using wildfly to deploy)     

   








    

 

Thursday, September 12, 2019

Convert pem(Privacy-Enhanced Mail) file to ppk(PuTTY Private Key) file - Mithun Technologies +91-9980923226

  Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 
Step1) To convert .pem file to .ppk , we need to use the puttygen software.
Download the puttygen(for 64 bit Windows OS) software by using below url.


https://the.earth.li/~sgtatham/putty/latest/w64/puttygen.exe



Step2) Open the puttygen software.

Click on puttygen.exe icon.



Once you have double clicked on puttygen.exe file, it will open the below screenshot.

Step3) Load the pem file as follows.
Click on Load button and select the pem file and click on Open, as follows.


Once you have clicked on Open, you will see below popup, click on OK button.



Step4) Save the ppk file.

Click on Save private key button and select the path to store the ppk file as follows.




Give the filename for ppk file and click on Save button as follows.




Click on close symbol, once you have successfully generated.



Step5) Login into AWS EC2 instance  using ppk file as follows.

Download the putty software (for 64 bit Windows OS) from below url if you don’t have downloaded already from below url.


Once you have downloaded the putty software copy the putty software executable file (putty.exe) from Downloads folder to Desktop.

Open the Putty software. (Double click on putty.exe file), as follows.


Give the IP address of which server you want to connect as follows.


Select the ppk file
Expand on SSH --> Expand Auth --> Click on Browse and select the ppk file and click on Open button as follows.

Give the username as ec2-user for RHEL instance and hit the Enter button.



Type exit command for disconnecting.



Ansible Installation in Amazon Linux - Mithun Technologies - 9980923226

  Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com                                                 ...