Total Pageviews

Search This Blog

Copyright to Cloud TechNet organization . Powered by Blogger.

Pages

Blogger templates

Thursday, 17 August 2023

Docker Basic Commands


1. check docker version

docker --version

2. To manage private docker images from docker client

docker login

3. To search any image from hub.docker.com

docker search <image name>

ex: docker search nginx

4. To download image from hub.docker.com

docker pull <image name>

ex: docker pull nginx

5. To check image list

docker images

or

docker image ls

6. To check detailed history of image

docker history <image name>

docker history nginx

7. To download specific version of image

docker pull <image name>:<Tag #>

ex: docker pull nginx:1.25.2

8. To inspect docker image

docker inspect image <image name>

ex: docker inspect image nginx

9. To check running containers

docker ps

10.To check all running & not running containers

docker ps -a

11.Create container from image

docker create <image name>

ex:docker create nginx

docker create <image name:Tag#>

ex:docker create nginx:1.24.0

12.how to run the container

docker start <container id> or <container name>

ex: docker start 2f32b2910411

docker start  wonderful_brahmagupta

13. create container with name

docker create --name <Type your container Name> <image name>

ex: docker create --name web-server01 nginx

14. Start container with name

docker start <container name>

ex: docker name web-server01

15. Stop the container

docker stop <container id> or <container name>

ex: docker stop web-server01

16. Remove the container

docker rm <container id>

17. Remove docker image

docker rmi <image id>

18. Forcefully remove docker image

docker rmi -f <image id>

19. Create container and start the container in single step

docker run --name web-server01 nginx
 
 
 
 

Tuesday, 15 August 2023

Installation of Docker on Amazon Linux:


Create a Linux Instance in AWS.

After Creating Connect the Instance to Putty Session.

Login Session as ec2-user then it's connects to Amazon Linux

 

 

For Root Login run the command sudo su and click enter

It's connects to root user

 

After Connecting to root user, run the command yum install docker -y

For Installation of Docker and click enter then Installation Starts

 

After successful installation it shows complete

 

After Docker Installation run some commands for information

For Docker service run the command service docker start

       Docker Version run the command docker –version

       Docker information run the command docker info

 

 
 
 

Sunday, 18 June 2023

Install Jenkins on Ubuntu server ?



1. Create Ubuntu 22.04 EC2 instances in any region.

2. Connect the server with Putty

3. Verify JDK versions in Ubuntu instance

$ sudo apt search jdk

4. Add apt repository for openjdk

$ sudo add-apt-repository ppa:openjdk-r/ppa

5. update ubuntu OS

$ sudo apt update

6. Install OpenJDK 11

$ sudo apt install openjdk-11-jdk

7. Install Jenkins on Ubuntu from jenkins.to website

https://www.jenkins.io/doc/book/installing/linux/


curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins


8. Check the status of jenkins

$ systemctl status jenkins

9. Check if the service is enabled or not ?

$ systemctl is-enabled jenkins

10. Check port configuration in Jenkins server?

$ ps -ef | grep jenkins

11. Check whether the port 8080 is opened or not?

$ss -tunpl | grep 8080

12. How to connect jenkins server from browser?

www.pubip:8080

13. How to login for the first time in the jenkins web console with a temp password?

Note: temp password location is "/var/lib/jenkins/secrets/initialAdminPassword" by default

From putty: (you can run the below command to get temp password)

cat /var/lib/jenkins/secrets/initialAdminPassword


 
 

Wednesday, 1 March 2023

How to install CodeDeploy install on Amazon Linux | Git | Cloudtechnet


 To install CodeDeploy agent on Amazon Linux, you can follow these steps:

  1. Log in to your Amazon Linux instance using SSH.

  2. Update the package manager by running the following command:

    sudo yum update -y

  3. Install the CodeDeploy agent by running the following command:

    sudo yum install -y ruby

    sudo yum install -y aws-cli wget https://aws-codedeploy-ap-south-1.s3.ap-south-1.amazonaws.com/latest/install chmod +x ./install sudo ./install auto





Monday, 20 February 2023

How to configure environment variables for Git services in windows systems ?


 To configure environment variables for Git services in Windows systems, you can follow these steps:

  1. Open the Start menu and search for "Environment Variables".

  2. Click on "Edit the system environment variables".

  3. In the System Properties window that appears, click on the "Environment Variables" button.

  4. In the Environment Variables window, locate the "Path" variable under the "System Variables" section and click the "Edit" button.

  5. Click the "New" button and add the path to the Git installation directory, which should be something like "C:\Program Files\Git\bin".

  6. Click "OK" to close all the windows.

  7. Open a new command prompt or PowerShell window, and type "git" to verify that Git is now recognized as a command.

That's it! You have now configured the environment variables for Git in your Windows system. This will allow you to use Git commands from any directory in your system, without having to specify the full path to the Git executable every time.

Git basic commands


 Here are some basic Git commands that you can use to manage your code repository:

  1. git init: Initializes a new Git repository in the current directory.

  2. git clone <repository_url>: Clones an existing Git repository from the specified URL.

  3. git add <file_name>: Adds the specified file to the staging area.

  4. git add .: Adds all modified and new files to the staging area.

  5. git commit -m "<commit_message>": Commits the changes in the staging area to the repository, with the specified commit message.

  6. git push: Pushes the changes from your local repository to the remote repository.

  7. git pull: Pulls the changes from the remote repository to your local repository.

  8. git status: Shows the status of the current branch and any modified or untracked files.

  9. git log: Shows the commit history for the current branch.

  10. git branch: Shows a list of all branches in the repository, with an asterisk next to the currently checked out branch.

  11. git checkout <branch_name>: Switches to the specified branch.

  12. git merge <branch_name>: Merges the specified branch into the current branch.

These are just a few of the basic Git commands. Git has many more commands and options that can be used to manage and collaborate on code repositories.

How to install Git on Windows system ?


Here are the steps to install Git on a Windows system:

  1. Download the Git installer for Windows from the official Git website: https://git-scm.com/download/win

  2. Run the downloaded installer file and follow the prompts in the installer.

  3. In the Select Components screen, leave the default options selected and click Next.

  4. In the Adjusting your PATH environment screen, select the option "Use Git from the Windows Command Prompt" and click Next.

  5. In the Configuring the line ending conversions screen, leave the default options selected and click Next.

  6. In the Configuring the terminal emulator to use with Git Bash screen, leave the default option selected and click Next.

  7. In the Configuring extra options screen, leave the default options selected and click Next.

  8. In the Installing screen, click Install to begin the installation.

  9. Once the installation is complete, click Finish.

  10. To verify that Git has been installed successfully, open a command prompt and run the command git --version. This should display the version number of Git installed on your system.

That's it! Git is now installed on your Windows system and ready to use.