sredient

Chapter 3: Docker Volume and Docker Network

Docker Volume and Network Docker Volume Docker volume is simply a directory inside container or a persistence storage volume in container. Volume will be create, when you create a container.We can share a volume with other container also.Volume can be mapped/share in two ways Container to Container Host to Container Docker Network Docker Network is used establish communication between containers and host machine.Docker network can be created automatically and manually.Docker contains mainly three types of network. Bridge – default network Host – can be created or for standalone container Null – null or none can be used for not to provide communication to container Docker Volume Commands To List a Volumes $ sudo docker volume ls To Create a Volume $ sudo docker volume create <volume-name> To get Information about Volume $ sudo docker volume inspect <volume-name> Example:- To Mount Volume to a Container $ sudo docker run –mount source=[volume_name],destination=[path_in_container] [docker_image_name] To Run a Container and mount a volume then use this command $ sudo docker run -it –name=sredient –mount source=<volume-name>,destination=/<volume-name> <image-name> Example:- To Share volume from Host to container $ sudo docker run -it –name=sredient –mount source=<volume-name or volume-path>,destination=/<volume-name> <image-name> To Remove Volumes $ sudo docker rm <volume-name> To Remove all Unused volumes $ sudo docker prune Docker Network Commands To List a networks $ sudo docker network ls To know more opetions $ sudo docker network –help To connect a container to a network $ sudo docker connect <network-id/name> <container-id> To disconnect from a network $ sudo docker disconnect <network-id/name> <container-id> To create a network $ sudo docker network create -d <network-type> <network name> To know more about Create Command $ sudo docker network create –help To remove Network $ sudo docker network rm

Chapter 3: Docker Volume and Docker Network Read More »

Chapter 2: Docker Containers and Images

Docker Containers and Images Docker Containers What is a Container? Container is like a virtual machine which holds the entire packages that is needed to run the application. Containers are more portable and lightweight. What is Image in docker? Docker images are the read only binary templates used to create docker containers. Images become containers when they run on docker engine. Basic information about Container and Image Container ID:- 579c25a52e88Image:- UbuntuImage Name:- upbeat_panini Remember above information, It will help you to know, how the Container Id, Image type and Image name look likes. Basic commands for Docker Containers To list running containers $ sudo docker container psor$ sudo docker container ls To List all containers $ sudo docker container ps -aor $ sudo docker ps -a To start docker container $ sudo docker start <container-id> To Stop docker container $ sudo docker stop <container-id> To check containers Logs $ sudo docker logs -f <container-id> To go inside container $ sudo docker attach <container-id> To Remove a stopped container $ sudo docker rm <container-id> To Remove a running container $ sudo docker rm -f <container-id> To Remove all Stopped containers $ sudo docker rm $(docker ps -q -f “status=exited”) To Remove all Running containers $ sudo docker rm -f $(docker ps -aq) Basic commands for Docker Images To list Docker Images $ sudo docker images lsor $ sudo docker images ps To find images in Docker hub $ sudo docker search <image-name> To download the Docker images from Docker hub $ sudo docker pull <image-name> To build a Image from Dockerfile $ sudo docker build -t <image-name>:<tag-name> . To check the history of Image $ sudo docker history <image-name> To Export Docker Image $ sudo docker (image-name) >(filename).rar To Import Docker Images $ sudo docker <filename.rar> <image-name> To Push docker image in Docker hub $ sudo docker push <registory-name>/<username>/<image-name> To Remove docker Images $ sudo docker rmi <image-name> To Remove docker images forcefully $ sudo docker rmi -f <image-name> To Remove all docker images $ docker rmi $(docker images -q)

Chapter 2: Docker Containers and Images Read More »

Getting Started with Docker

Getting started with docker Docker Installation in Ubuntu Linux For the following Ubuntu Versions Ubuntu Jammy 22.04 (LTS) Ubuntu Impish 21.10 Ubuntu Focal 20.04 (LTS) Ubuntu Bionic 18.04 (LTS) If you have Older Docker version or already installed and went remove, then run the below commands Docker Remove Commands $ sudo apt-get remove docker docker-engine docker.io containerd runc $ sudo rm -rf /var/lib/docker /etc/docker$ sudo rm /etc/apparmor.d/docker$ sudo groupdel docker$ sudo rm -rf /var/run/docker.sock above commands will remove docker completely from your system Now let’s start installation of docker First update your system $ sudo apt-get update Run below command to install packages to allow apt to use a repository over HTTPS: Add docker repositories in your ubuntu system $ sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release Now add docker official GPG key’s in your ubuntu system for this create separate directory for docker $ sudo mkdir -p /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg Now add the Docker Repository to APT sources list $ echo \ “deb [arch=$(dpkg –print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null Install Docker Engine $ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin Now docker is installed, check the docker status $ sudo systemctl status docker

Getting Started with Docker Read More »

Best DevOps tools in 2022

Top DevOps tools in 2022 1. Jenkins Jenkins is free and Open-source CI pipeline tool for DevOps. It automate the entire software development life cycle. It is community supported and might be your first choice tool for CI. 2. Docker Docker is an open-source centralised and containerization platform for DevOps. Docker allows you to create, deploy and run applications. Docker has fast and lightweight deployment containers and images. 3. Ansible Ansible is an open-source IT configuration management deployment and orchestration tools. Through ansible, your can install software’s, patches in network connected systems. Many DevOps engineers prefers Ansible to automate their infrastructure. 4. Git Git is a Source Code Management Tool.It is a free and open-source version control system. Git supports most of the version control features including check-in, commits, branches, merging, labels, push and pull from GitHub. 5. Kubernetes Kubernetes is an open-source container management tool which automates container deployment, container auto-scaling, networking and load balancing. It can create docker containers and deploy them for testing and production automatically.

Best DevOps tools in 2022 Read More »

Git Basics and Installtion

Git Basics Install git on Linux Step:- 1 Open your Terminal and run the below commands $ sudo apt-get update $ sudo apt-get install git Step:- 2 Verify the installation was successful by running below command $ git –version Configure git in local system Step:- 1. Open your terminal run the following commands $ git config –global user.name “Your Name”$ git config –global user.email “[email protected]”$ git config –list Example Let’s work with Git and Github Open your terminal and create one directory for git work $ mkdir redient-git$ cd redient-git/$ git init Example:- Now Create one file and write some lines $ sudo nano redient After saving file, run the following command $ git status Output The file is in workspace, and move it to staging area by the following command $ git add .$ git status output:- Now lets move this file from staging to Local repo and add our first commit $ git commit -m “this is my first commit”$ git status output: Now if you are working with team and went to know who commited to code then run the following commnad $ git log To see code using commit id $ git show <commit-id> Now push this code in Github, first login to github and create one repository their, below i have created one repo in my account Now run the below remote origin command $ git remote add origin https://github.com/redient-security/sredient.git$ git remote show origin Now run the push command $ git push -u origin master Type your username and password You face token error here to resolve it we need to create a token In github account, first go to setting then scroll down and click on Developer settings, Now click on Personal access tokens and now create one token here After creating token, now run again the same command and this time instead typing password, paste your github token and hit enter $ git push -u origin master Now got to github account and check your repository Now the code is successfully pushed in Github account if you want to pull it from github, run the following command $ git pull origin master

Git Basics and Installtion Read More »

5 Best Operating Systems(OS) for Hackers in 2022

5 Best Operating Systems(OS) For Hackers in 2022 1. Kali Linux Kali Linux is a Debian based Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security. Mostly Hackers and Security Researchers use Kali Linux to find security loop holes. 2. Parrot OS Parrot Operating System is Debian based Linux distribution designed for Hackers, Pentesters, Bug Hunters and Developers. Parrot OS mostly focus on Security, Development and Privacy. 3. BlackArch Black Arch is based on Arch Linux distribution and provide amazing preinstalled Cyber Security tools. BlackArch is designed for Penetration Testers and Security researchers. 4. Cyborg Hawk Cyborg Hawk Linux is based on Ubuntu with Latest Kernel of Cyber Security. It is most Advanced, Powerful Tools and with amazing UI. 5. Backbox Backbox is Ubuntu based Linux distribution Operating System. It has many powerful tools for Network scanning, Information gathering and Penetration testing.

5 Best Operating Systems(OS) for Hackers in 2022 Read More »

All about Git

About Git Git is a Source Code Management Tool.It is a free and open-source version control system.Git helps to keep track of different versions of a single code base by tracking all changes.Git is Distributed Version Control System(DVCS). Stages in git Workspace/Working directory Staging area Local Repository Workspace:- it is your working directory Staging Area:- Local repo:- Git CommitIt stores changes in repositoryIt uses SHA-1 checksum conceptIf you change anything in code then commit id will be changedYou can easily track changes through commit id Tags in gitTag assigns a meaningful name with a specific version in repository, like we let some change in code and assign tag with commit id to identify its easily. Git PushWhen we done with our code and went to add the code in remote repository, then we will use the push command to transfer the code from local repository to remote repository. Git PullPull command copy the code from remote repository to local repository Branch in GitBranch is a place where your code is placed, it may be master or main branch.Each task has one separate branch. Branch Merge Branch merge means if someone working some other code and you went to add their code in your branch/code then merge command will be use. Git Conflict When same file having different content in different branches, git conflict occurs when you merge them in single branch. Git Stashing Git stashing is a temporary storage for your code, it mean if your are working on new project and someone told you to work on old project, in this case you can store your new project in stashing area for few hours. Git ResetIt is powerful command that is used to reset local changes to the state of git repository. We will use this command when we want to discard the changes, it will revert the commit id to previous commit id. Git RevertThe revert command helps you to create new commit and it will create new commit which is opposite to existing commit without deleting data.

All about Git Read More »

wpChatIcon
    wpChatIcon