<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Debug School: Vipul Bisht</title>
    <description>The latest articles on Debug School by Vipul Bisht (@vipulbisht_982).</description>
    <link>https://www.debug.school/vipulbisht_982</link>
    <image>
      <url>https://www.debug.school/images/0NBZfTvlmMeP7ePl6bUU-fomLDz5XWw5h98kL98PUHA/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly93d3cu/ZGVidWcuc2Nob29s/L3VwbG9hZHMvdXNl/ci9wcm9maWxlX2lt/YWdlLzQ2MS85MGZk/NjI0Yy04NzQ1LTQy/Y2ItOWFhYi0xZTA0/ZDQ5NTcxYTcuanBn</url>
      <title>Debug School: Vipul Bisht</title>
      <link>https://www.debug.school/vipulbisht_982</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.debug.school/feed/vipulbisht_982"/>
    <language>en</language>
    <item>
      <title>Docker Day 2 Assignment By Vipul Bisht</title>
      <dc:creator>Vipul Bisht</dc:creator>
      <pubDate>Wed, 26 Apr 2023 12:13:28 +0000</pubDate>
      <link>https://www.debug.school/vipulbisht_982/docker-day-2-assignment-by-vipul-bisht-hhn</link>
      <guid>https://www.debug.school/vipulbisht_982/docker-day-2-assignment-by-vipul-bisht-hhn</guid>
      <description>&lt;p&gt;On Day 2, we got to learn about belows commands and how to create the docker image and create a tarball and push the image to the docker hub repo for public accessing by anyone .&lt;br&gt;
• cp&lt;br&gt;
• diff&lt;br&gt;
• rename&lt;br&gt;
• port&lt;br&gt;
• update&lt;br&gt;
• wait&lt;br&gt;
• logs&lt;br&gt;
• events&lt;br&gt;
• top&lt;br&gt;
• inspect&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker commands for images
&lt;/h3&gt;

&lt;p&gt;• docker images&lt;br&gt;
• docker pull&lt;br&gt;
• docker info&lt;br&gt;
• docker rmi&lt;br&gt;
• docker inspect&lt;br&gt;
• docker commit – m “message” – a”name” container id alias name&lt;/p&gt;

&lt;h3&gt;
  
  
  How to design docker image
&lt;/h3&gt;

&lt;p&gt;docker run -itd ubuntu&lt;br&gt;
docker exec -it “containerid” /bin/bash&lt;br&gt;
install java&lt;br&gt;
apt-get update&lt;br&gt;
apt-get install openjdk-11-jdk -y&lt;br&gt;
apt-get install openjdk-11-jdk-headless -y&lt;br&gt;
install apache&lt;br&gt;
apt-get install apache2 -y&lt;br&gt;
Install wget&lt;br&gt;
apt-get install wget -y&lt;br&gt;
Install war file&lt;br&gt;
wget &lt;a href="https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war"&gt;https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war&lt;/a&gt;&lt;br&gt;
chmod 755 sample.war&lt;br&gt;
commit the image&lt;/p&gt;

&lt;p&gt;docker commit -m"message" -a"Revour_Vipul" containerid name&lt;br&gt;
docker images&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validate java and apache
docker exec containerid java
docker exec containerid which apache2
docker exec containerid ls /opt/&lt;/li&gt;
&lt;li&gt;Saving and loading tar file
After committing the docker image&lt;/li&gt;
&lt;li&gt;Save the file
docker save -o image.tar name of image
&lt;em&gt;You can stop the containers if u want&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Load the file
docker load -i image.tar
### Docker Images:
Docker image is a collection of filesystes(Root FS(which also includes the user FS) + Application FS).
When creating a container all layers if image are merged together and are mounted to the container.
/var/lib/docker(this can be found in docker info command) is the path to get the info of the file system layers associated with image. Inorder to save the changes done(Like adding new files/folders, changing existing ones) to a container in the form of an image, we can use commit command docker commit -m "commit message" -a "author name" container_id new_name_of_the_image This command commits all the changes done to the container given in the command to a new image.
docker history new_name_of_the_image: To check what are the changes done on top of existing image, we can use history command on the committed image.
To save the image as a tar,
docker save -o name.tar name_of_image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To load the image which is saved as tar,&lt;br&gt;
docker load -i name.tar:&lt;br&gt;
Check the images using docker images command to see if the tar is loaded.&lt;/p&gt;

&lt;p&gt;To share an image with larger group of people then tar is not a feasible option, so we push the image to a docker registry from where everyone can access the image.&lt;br&gt;
Steps:&lt;/p&gt;

&lt;p&gt;docker login -&amp;gt; Login to the registry.(should have created an account prior)&lt;br&gt;
tag the docker image according to the repository created in your registry. The name of docker image is the repository and we will face errors while pushing if the repository we specified doesn't exist. docker tag my_image revour/demo_1 -&amp;gt; This tags my_image which is in my local to revour/demo_1(repository name in registry)&lt;br&gt;
docker push revour/demo_1  -&amp;gt; push to Registry&lt;br&gt;
We can validate the same using docker pull revour/demo_1 -&amp;gt; this should pull your image from registry.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day 3 Kubernetes Introduction By Vipul Bisht</title>
      <dc:creator>Vipul Bisht</dc:creator>
      <pubDate>Wed, 26 Apr 2023 09:56:43 +0000</pubDate>
      <link>https://www.debug.school/vipulbisht_982/day-3-kubernetes-introduction-by-vipul-bisht-31dg</link>
      <guid>https://www.debug.school/vipulbisht_982/day-3-kubernetes-introduction-by-vipul-bisht-31dg</guid>
      <description>&lt;h3&gt;
  
  
  What is Kubernetes?
&lt;/h3&gt;

&lt;p&gt;Kubernetes is a container orchestration system, extensible open-source platform for managing containerized workloads and services, for automating deployment, scaling, and management of containerized applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Kubernetes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No downtime for deployment&lt;/li&gt;
&lt;li&gt;Scalable&lt;/li&gt;
&lt;li&gt;Kubernetes helps developers build the ‘infrastructure as code’ and also helps them manage coding environment configurations as code. &lt;/li&gt;
&lt;li&gt;It is highly portable, as Kubernetes can be deployed on various infrastructures and environment configurations.&lt;/li&gt;
&lt;li&gt;Kubernetes, also known as K8s, can handle the storage, networking, and computational aspects of cloud applications on its own. &lt;/li&gt;
&lt;li&gt;Kubernetes hosts a lot of built-in commands for automating many daily operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Explained Kubernetes Architecture
&lt;/h3&gt;

&lt;p&gt;A Kubernetes cluster consists of control plane nodes and worker nodes.&lt;/p&gt;

&lt;p&gt;1) Control Plane&lt;br&gt;
The control plane is responsible for container orchestration and maintaining the desired state of the cluster. It has the following components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;kube-apiserver&lt;/li&gt;
&lt;li&gt;etcd&lt;/li&gt;
&lt;li&gt;kube-scheduler&lt;/li&gt;
&lt;li&gt;kube-controller-manager&lt;/li&gt;
&lt;li&gt;cloud-controller-manager&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) Worker Node&lt;br&gt;
The Worker nodes are responsible for running containerized applications. The worker Node has the following components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;kubelet&lt;/li&gt;
&lt;li&gt;kube-proxy&lt;/li&gt;
&lt;li&gt;Container runtime&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Master Components
&lt;/h3&gt;

&lt;p&gt;The Kubernetes master runs the Scheduler, Controller Manager, API Server and etcd components and is responsible for managing the Kubernetes cluster. Essentially, it’s the brain of the cluster. It's components are -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Etcd&lt;br&gt;
Etcd is a distributed, consistent key-value store used for configuration management, service discovery, and coordinating distributed work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;API Server&lt;br&gt;
When you interact with your Kubernetes cluster using the kubectl command-line interface, you are actually communicating with the master API Server component.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Controller Manager&lt;br&gt;
The Kubernetes Controller Manager is a daemon that embeds the core control loops (also known as “controllers”) shipped with Kubernetes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scheduler&lt;br&gt;
The Scheduler watches for unscheduled pods and binds them to nodes via the /binding pod subresource API, according to the availability of the requested resources, quality of service requirements, affinity and anti-affinity specifications, and other constraints.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the pod has a node assigned, the regular behavior of the Kubelet is triggered and the pod and its containers are created&lt;/p&gt;

&lt;h3&gt;
  
  
  Worker Components
&lt;/h3&gt;

&lt;p&gt;1) Kubelet is an agent that runs on each worker node and communicates with the master node. It also makes sure that the containers which are part of the pods are always healthy. It watches for tasks sent from the API Server, executes the task like deploy or destroy the container, and then reports back to the Master.&lt;/p&gt;

&lt;p&gt;2) Kube-proxy is used to communicate between the multiple worker nodes. It maintains network rules on nodes and also make sure there are necessary rules define on the worker node so the container can communicate to each in different nodes.&lt;/p&gt;

&lt;p&gt;3) Kubernetes pod is a group of one or more containers that are deployed together on the same host. Pod is deployed with a shared storage/network, and a specification for how to run the containers. Containers can easily communicate with other containers in the same pod as though they were on the same machine.&lt;/p&gt;

&lt;p&gt;4) Container Runtime is the software that is responsible for running containers. Kubernetes supports several container runtimes: Docker, containers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Workstation Components
&lt;/h3&gt;

&lt;p&gt;Here are some of the components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Kubernetes CLI (kubectl): The Kubernetes CLI, or kubectl, is a command-line tool that allows developers and administrators to interact with Kubernetes clusters from their local workstations. With kubectl, users can create, modify, and delete Kubernetes objects such as pods, services, and deployments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kubernetes Dashboard: The Kubernetes Dashboard is a web-based UI that provides a graphical interface for managing Kubernetes clusters. It allows users to view the state of the cluster, create and modify objects, and monitor the health of the cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Container Registry: A container registry is a service that allows users to store and distribute container images. Developers can use a container registry to store their container images and then deploy those images to a Kubernetes cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Text Editor or Integrated Development Environment (IDE): Developers can use a text editor or IDE to write and edit Kubernetes manifests and other configuration files. This can be useful for creating and modifying objects, debugging issues, and troubleshooting problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Continuous Integration/Continuous Deployment (CI/CD) Tools: CI/CD tools such as Jenkins, CircleCI, and GitLab can be used to automate the deployment of containerized applications to Kubernetes clusters. These tools can be used to build container images, test them, and then deploy them to a Kubernetes cluster.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these help to interact with Kubernetes clusters from their local workstations and streamline the development and deployment of containerized applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is POD?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Pod is similar to a set of containers with shared namespaces and shared filesystem volumes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kubernetes</category>
      <category>beginners</category>
      <category>kubernetesintro</category>
      <category>containerization</category>
    </item>
    <item>
      <title>Day 1 Docker - Assignment By Vipul Bisht</title>
      <dc:creator>Vipul Bisht</dc:creator>
      <pubDate>Tue, 25 Apr 2023 12:15:13 +0000</pubDate>
      <link>https://www.debug.school/vipulbisht_982/day-1-docker-assignment-by-vipul-kee</link>
      <guid>https://www.debug.school/vipulbisht_982/day-1-docker-assignment-by-vipul-kee</guid>
      <description>&lt;h3&gt;
  
  
  What is Docker?
&lt;/h3&gt;

&lt;p&gt;Docker is container management tool.&lt;br&gt;
Docker Engine popularly known by docker, is similar in concept to Virtual Machines, except it’s much more lightweight. Instead of running an entire separate operating system, Docker runs containers, which use the same host operating system, and only virtualize at a software level by developing required filesystem structure and replicate into many instances.It provides the ability to package and run an application in an isolated environment i.e; containers. The isolation and security allows you to run many containers simultaneously on a given host.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why We need docker?
&lt;/h3&gt;

&lt;p&gt;Docker has many reasons as to why it widely used which are listed as below-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It reduces the cost as due to dockers images concept can be worked upon in a distributed fashion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It saves time as it deploys code quickly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It improves software quality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's Portable Across Machines and you may deploy your containerized program to any other system that runs Docker after testing it. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's Lightweight and due to Containers' portability and performance advantages can aid in making your development process more fluid and responsive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It works in isolated manner .Even if you are running a container, it’s guaranteed not to be impacted by any host OS securities or unique setups, unlike with a virtual machine or a non containerized environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker is quite Scalable too and if the demand for your apps necessitates, you can quickly generate new containers.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What is Container?
&lt;/h3&gt;

&lt;p&gt;In simple meaning, a container is a sandboxed process on your machine that is isolated from all other processes on the host machine. That isolation leverages kernel namespaces and cgroups, features.To summarize, a container:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Is a runnable instance of an image. You can create, start, stop, move, or delete a container using the DockerAPI or CLI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can be run on local machines, virtual machines or deployed to the cloud.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is portable (can be run on any OS).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is isolated from other containers and runs its own software, binaries, and configurations._&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How Container Works?
&lt;/h3&gt;

&lt;p&gt;You can create, start, stop, move, or delete a container.&lt;br&gt;
Containers do not carry any Guest OS with them the way a VM must.&lt;br&gt;
Containerized applications are tied to all its dependencies as a single deployable unit. Leveraging the features and capabilities of the host OS, containers enable these software apps to work in all environments. Docker Engine requests kernel to create independent computational resources like network,PID,mount and username, those  all resources combined and creates a runtime environment for application which is a single container.&lt;/p&gt;

&lt;p&gt;Key difference between kernal and container is as below-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;BOOT FILESYSTEM --&amp;gt; ROOT FILESYSTEM --&amp;gt; USER FILESYSTEM --&amp;gt; APP FILESYSTEM (OS Kernal)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ROOT FILESYSTEM --&amp;gt; USER FILESYSTEM --&amp;gt; APP FILESYSTEM (Container)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to install Docker?
&lt;/h3&gt;

&lt;p&gt;Docker provides convenience scripts at get.docker.com.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download and Run the script.&lt;br&gt;
$ curl -fsSL get.docker.com -o get-docker.sh&lt;br&gt;
$ sudo sh get-docker.sh&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable Docker&lt;br&gt;
$ sudo systemctl enable docker&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start Docker&lt;br&gt;
$ sudo systemctl start docker&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify that docker is installed correctly by running the hello-world image.&lt;br&gt;
$ sudo docker run hello-world&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What are the components of docker?
&lt;/h3&gt;

&lt;p&gt;There are four components of docker-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Docker client and server-This is a command-line-instructed solution in which you would use the terminal on your Mac or Linux system to issue commands from the Docker client to the Docker daemon. The communication between the Docker client and the Docker host is via a REST API. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker image -A Docker image is a template that contains instructions for the Docker container. The Docker image is built within the YAML file and then hosted as a file in the Docker registry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker registry -The Docker registry is where you would host various types of images and where you would distribute the images from. The repository itself is just a collection of Docker images, which are built on instructions written in YAML and are very easily stored and shared.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker container -The Docker container is an executable package of applications and its dependencies bundled together. The container is built using Docker images.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two more advanced components of Docker are-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Docker compose - Docker-compose is designed for running multiple containers as a single service. It does so by running each container in isolation but allowing the containers to interact with one another. As noted earlier, you would write the compose environments using YAML.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker swamp -Docker swarm is a service for containers that allows IT administrators and developers to create and manage a cluster of swarm nodes within the Docker platform. Each node of Docker swarm is a Docker daemon, and all Docker daemons interact using the Docker API. A swarm consists of two types of nodes: a manager node and a worker node. A manager node maintains cluster management tasks. Worker nodes receive and execute tasks from the manager node.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What is a container lifecycle commands?
&lt;/h3&gt;

&lt;p&gt;There are different stages when we create a Docker container which is known as Docker Container Lifecycle. Some of the states are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create phase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create Containers- docker create --name  &lt;br&gt;
Start Container- docker start &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running phase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run Container- &lt;br&gt;
docker run --name  &lt;br&gt;
In an interactive manner-&lt;br&gt;
docker run -it --name  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paused phase/unpause phase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pause Container-docker pause &lt;br&gt;
Unpause Container-docker unpause &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stopped phase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stop Container-docker stop &lt;br&gt;
To stop all the running containers- docker stop $(docker container ls –aq)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Killed phase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Delete Container-docker rm &lt;br&gt;
Delete all containers using a single command- docker rm $(docker ps -aq)&lt;/p&gt;

&lt;p&gt;Kill Container-docker kill &lt;/p&gt;

&lt;h3&gt;
  
  
  What is docker pause/unpause?
&lt;/h3&gt;

&lt;p&gt;The docker pause command suspends all processes in the specified containers. On Linux, this uses the freezer cgroup. Traditionally, when suspending a process the SIGSTOP signal is used, which is observable by the process being suspended. With the freezer cgroup the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. On Windows, only Hyper-V containers can be paused.&lt;br&gt;
Ex- docker pause &lt;/p&gt;

&lt;p&gt;The docker unpause command un-suspends all processes in the specified containers. On Linux, it does this using the freezer cgroup.&lt;br&gt;
Ex- docker unpause &lt;/p&gt;

&lt;h3&gt;
  
  
  What is docker stop/kill?
&lt;/h3&gt;

&lt;p&gt;Docker stop command stop one or more running containers.&lt;br&gt;
The main process inside the container will receive SIGTERM, and after a grace period, SIGKILL. It end the session with Exit (0) code and stops container gracefully.&lt;br&gt;
Ex- docker stop &lt;/p&gt;

&lt;p&gt;Docker kill command is kind of similar to docker stop command however it sends SIGKILL signal to our running container process. SIGKILL signal immediately shuts the container down without taking any pause. It terminate the session forcefully with Exit (137) code.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to get inside a container?
&lt;/h3&gt;

&lt;p&gt;First attempt to attach to a container-&lt;br&gt;
docker run -itd ubuntu /bin/bash&lt;/p&gt;

&lt;p&gt;Then to get inside a Docker container , you can use Shell and try to run docker exec command to get inside the container-&lt;br&gt;
docker exec  ls(or any other linux command/s can also be used)&lt;/p&gt;

&lt;h3&gt;
  
  
  How to access container from outside?
&lt;/h3&gt;

&lt;p&gt;Container can be accessed from outside by using network commands-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;docker inspect 71afb466705d -- to inspect the container parameters&lt;/li&gt;
&lt;li&gt;docker ps -- to check the running container information&lt;/li&gt;
&lt;li&gt;curl &lt;a href="http://172.17.0.1"&gt;http://172.17.0.1&lt;/a&gt; --to check if success messages(It works) is sent or not&lt;/li&gt;
&lt;li&gt;ping "172.17.0.1" --to check through sending ping in form of data packets&lt;/li&gt;
&lt;li&gt;history&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is the rule for container is running?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;PID1 has to run with anything (because no kernel in the container) which has not been exited.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The container by default, runs in foreground unless explicitly detached using the -d flag.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The container runs as long as the specified command keeps running and then stops.In Unix only, there's an exception we have CTRL+P+Q to exit a shell and not let it know that the process has exited yet and container keeps on running still.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devops</category>
      <category>beginners</category>
      <category>dockercontainers</category>
      <category>dockersessions</category>
    </item>
  </channel>
</rss>
